程式隨筆

Never give up!


  • Home

  • Categories

  • Archives

  • Tags

UVA11311

Posted on 2017-01-16 | In Competitive Programming , UVa

Exclusively Edible

AC Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <bits/stdc++.h>
using namespace std;
int main()
{
int ncase;
scanf("%d", &ncase);
while(ncase--) {
int r, c, x, y;
scanf("%d %d %d %d", &r, &c, &x, &y);
int val = (x + 1) ^ (r - x) ^ (y + 1) ^ (c - y);
printf("%s\n", val == 0 ? "Hansel" : "Gretel");
}
return 0;
}
# Game theory # Sprague Grundy Number # UVa
POJ3040
HDU 1848
  • Table of Contents
  • Overview
Henry Tseng

Henry Tseng

64 posts
18 categories
57 tags
  1. 1. Exclusively Edible
    1. 1.1. AC Code
© 2017 Henry Tseng
Powered by Hexo
Theme - NexT.Pisces