期望得分:100+0+10
实际得分:40+0+0
考炸了。。。
T1:题目链接
究竟为什么会这样,,,
仔细研读我的丑代码
发现。。。
枯辽。。。。
#include<cstdio> #include<algorithm> #include<cstring> #include<iostream> using namespace std; int T,n; int a[1001]; int flag; inline void out1() { cout<<"rabbit"<<"\n"; } inline void out2() { cout<<"hamster"<<"\n"; } inline int read(); int main() { T=read(); while(T--) { n=read(); memset(a,0,sizeof a); flag=true; for(int i=1; i<=n; i++) { a[i]=read(); if(a[i]==1)flag++; } /* if(flag) { if(n%2)out1(); else out2(); continue; }*/ if(n==1) { if(a[1]==1)out1(); else out2(); continue; } if(flag%2)out2(); else out1(); } return 0; } inline int read() { int s=0,w=1; char ch=getchar(); while(ch<'0'||ch>'9') { if(ch=='-')w=-1; ch=getchar(); } while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48),ch=getchar(); return s*w; }