摘要: john 必胜:1,所有均为1且SG值为0;2,有些堆大于1且SG值不为0。#include"iostream"using namespace std;int main(){ int k; cin>>k; while(k--) { int flag=1,n,i,s[50],ans=0; cin>>n; for(i=0;i<n;i++) { cin>>s[i]; if(s[i]!=1) flag=0; ans^=s[i]; } if(flag) { if(!ans) cout<<"John"<&l 阅读全文
posted @ 2011-05-11 15:44 Ac_smile 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Stan and Ollie play the game of multiplication by multiplying an integer p by one of the numbers 2 to 9. Stan always starts with p = 1, does his multiplication, then Ollie multiplies the number, then Stan and so on. Before a game starts, they draw an integer 1 < n < 4294967295 and the winner i 阅读全文
posted @ 2011-05-11 15:01 Ac_smile 阅读(247) 评论(0) 推荐(0) 编辑