题目链接:http://acm.tju.edu.cn/toj/showp3861.html
3861. Erase
Ann is playing a number game with her friend Bob. They are both very clever.
At first, there are n consecutive numbers. Each time Ann and Bob will erase a number in turn until only 2 numbers left. Ann always goes first. If the last 2 numbers are coprime, then Ann wins. Otherwise Bob wins. Being coprime means that 2 numbers have no common factor other than 1.
For example, there are 3 consecutive numbers 6, 7, and 8, from 6 to 8. Ann will erase 6 so that only 7 and 8 are left. Bob shouldn't erase any number because there are only 2 numbers. Obviously 7 and 8 are coprime so that Ann wins. To simplify this problem, you can assume that n is an odd number.
A line contains an integers n ( 2 < n < 2^32).
Print a line "Ann wins". if Ann could win, or "What a pity!" .
题意很简单,结论是Ann永远会赢,至于为什么,稍后更新。。
#include <stdio.h> int main(){ long long n; while(~scanf("%lld",&n)) printf("Ann wins.\n"); }