HDU 1849 Rabbit and Grass

来源:互联网 发布:python爬虫入门书籍 编辑:程序博客网 时间:2024/05/19 17:59

传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1850

题目大意:中文题目不解释


分析:

         赤果果的NIM,再次不解释。

代码

#include <iostream>using namespace std;int main(){    int ans,n,t;    while(cin >> n && n)    {        ans = 0;        while(n--)        {            cin >> t;            ans ^= t;        }        if(ans)        cout << "Rabbit Win!" << endl;        else        cout << "Grass Win!" << endl;    }    return 0;}


原创粉丝点击