手推前几个可以知道规律:n>2时是P态,n<=2时是N态。
注意:石子拿去后,剩下的石子是分散的。
AC代码
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <utility>
#include <string>
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
#define eps 1e-10
#define inf 0x3f3f3f3f
#define PI pair<int, int>
typedef long long LL;
const int maxn = 1e4 + 5;
int main() {
int n;
while(scanf("%d", &n) == 1) {
if(n == 0 || n > 2) printf("Yougth\n");
else printf("Hrdv\n");
}
return 0;
}
如有不当之处欢迎指出!