Submission #70111294
Source Code Expand
#include<bits/stdc++.h>
//bool Mst;
using namespace std;
namespace wyzfastio
{
const char bool_str[2][6]={"false","true"};const int double_mx=12;
//#define usefio
#ifdef usefio
namespace __getchar{const int bufsize=1<<22;char buf[bufsize],*p1=buf,*p2=buf;inline char getchar(){return (p1==p2&&(p2=(p1=buf)+fread(buf,1,bufsize,stdin),p1==p2))?EOF:(*p1++);}}using __getchar::getchar;
namespace __putchar{const int bufsize=1<<22;char buf[bufsize],*p=buf;inline void putchar(const char ch){if(p-buf==bufsize) fwrite(buf,1,bufsize,stdout),p=buf;*p++=ch;}inline void flush(){fwrite(buf,1,p-buf,stdout);}}using __putchar::putchar;using __putchar::flush;
namespace __flusher{struct Flusher{Flusher(){}~Flusher(){flush();}}flusher;}
#endif
struct istream{void tie([[maybe_unused]]int x){}};struct ostream{void tie([[maybe_unused]]int x){}};istream in;ostream out;
istream &operator>>(istream &in,char &s){s=getchar();while(s==' '||s=='\n'||s=='\r')s=getchar();return in;}
istream &operator>>(istream &in,std::string &s){char ch=getchar();s.clear();while(ch==' '||ch=='\n'||ch=='\r')ch=getchar();while(!(ch==' '||ch=='\n'||ch=='\r'||ch==EOF))s+=ch,ch=getchar();return in;}
istream &operator>>(istream &in,__int128 &x){char ch=getchar();int o=0;__int128 r=0;while(ch<'0'||ch>'9'){if(ch=='-')o^=1;ch=getchar();}while(ch>='0'&&ch<='9')r=(r<<3)+(r<<1)+ch-'0',ch=getchar();x=o?-r:r;return in;}
istream &operator>>(istream &in,unsigned __int128 &x){char ch=getchar();__int128 r=0;while(ch>='0'&&ch<='9')r=(r<<3)+(r<<1)+ch-'0',ch=getchar();x=r;return in;}
template<typename _Tp>inline typename std::enable_if<std::is_integral<_Tp>::value&&!std::is_same<_Tp,bool>::value,istream &>::type operator>>(istream &in,_Tp &x){char ch=getchar();int o=0;_Tp r=0;while(ch<'0'||ch>'9'){if(ch=='-')o^=1;ch=getchar();}while(ch>='0'&&ch<='9')r=(r<<3)+(r<<1)+ch-'0',ch=getchar();x=o?-r:r;return in;}
template<typename _Tp>inline typename std::enable_if<std::is_same<_Tp,bool>::value,istream &>::type operator>>(istream &in,_Tp &x){int r;in>>r;x=r;}
template<typename _Tp>inline typename std::enable_if<std::is_floating_point<_Tp>::value,istream &>::type operator>>(istream &in,_Tp &x){_Tp r=0,p=1;int op=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')op=-op;ch=getchar();}while(ch>='0'&&ch<='9'){r=r*10+ch-'0';ch=getchar();}if(ch=='.'){ch=getchar();while(ch>='0'&&ch<='9')r+=(p*=0.1)*(ch-'0'),ch=getchar();}x=r*op;return in;}
ostream &operator<<(ostream &out,const char x){putchar(x);return out;}
ostream &operator<<(ostream &out,const char *s){while(*s!='\0'&&*s!=EOF)putchar(*s),s++;return out;}
ostream &operator<<(ostream &out,std::string s){for(char ch:s)putchar(ch);return out;}
ostream &operator<<(ostream &out,__int128 x){static int __stk[66];int top=0,op=1-((x<0)<<1);if(x==0)__stk[top++]=0;else while(x)__stk[top++]=(x%10)*op,x/=10;if(op==-1)putchar('-');while(top)putchar(__stk[--top]+'0');return out;}
ostream &operator<<(ostream &out,unsigned __int128 x){static int __stk[66];int top=0;if(x==0)__stk[top++]=0;else while(x)__stk[top++]=(x%10),x/=10;while(top)putchar(__stk[--top]+'0');return out;}
template<typename _Tp>inline typename std::enable_if<std::is_integral<_Tp>::value&&!std::is_same<_Tp,bool>::value,ostream &>::type operator<<(ostream &out,_Tp x){static int __stk[33];int top=0,op=1-((x<0)<<1);if(x==0)__stk[top++]=0;else while(x)__stk[top++]=(x%10)*op,x/=10;if(op==-1)putchar('-');while(top)putchar(__stk[--top]+'0');return out;}
template<typename _Tp>inline typename std::enable_if<std::is_same<_Tp,bool>::value,ostream &>::type operator<<(ostream &out,_Tp x){out<<bool_str[x];return out;}
#define cin wyzfastio::in
#define cout wyzfastio::out
}
using ll=long long;
using ld=long double;
//#define int ll
using pii=pair<int,int>;
//bool Med;
signed main()
{
// cerr<<"Memory Size: "<<abs((&Med)-(&Mst))/1024.0/1024<<" MB\n";
// freopen("in.in","r",stdin);
// freopen("out.out","w",stdout);
int t;cin>>t;
while(t--) [&]()->void
{
int n,s=0,t=0;
cin>>n;
for(int i=1,x;i<=n;i++) cin>>x,s^=x,t|=x;
if(s==t) cout<<"Bob\n";
else cout<<"Alice\n";
}();
return 0;
}
Submission Info
| Submission Time |
|
| Task |
A - Bitwise OR Game |
| User |
wangyizhi |
| Language |
C++ 20 (gcc 12.2) |
| Score |
500 |
| Code Size |
4140 Byte |
| Status |
AC |
| Exec Time |
10 ms |
| Memory |
3676 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
500 / 500 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_00.txt |
| All |
00_sample_00.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 02_Bob_00.txt, 02_Bob_01.txt, 02_Bob_02.txt, 02_Bob_03.txt, 02_Bob_04.txt, 02_Bob_05.txt, 02_Bob_06.txt, 02_Bob_07.txt, 02_Bob_08.txt, 03_Alice_00.txt, 03_Alice_01.txt, 03_Alice_02.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
AC |
1 ms |
3520 KiB |
| 01_handmade_00.txt |
AC |
7 ms |
3484 KiB |
| 01_handmade_01.txt |
AC |
10 ms |
3676 KiB |
| 01_handmade_02.txt |
AC |
5 ms |
3468 KiB |
| 01_handmade_03.txt |
AC |
9 ms |
3412 KiB |
| 01_handmade_04.txt |
AC |
10 ms |
3492 KiB |
| 01_handmade_05.txt |
AC |
9 ms |
3428 KiB |
| 01_handmade_06.txt |
AC |
8 ms |
3492 KiB |
| 01_handmade_07.txt |
AC |
7 ms |
3492 KiB |
| 01_handmade_08.txt |
AC |
7 ms |
3544 KiB |
| 01_handmade_09.txt |
AC |
7 ms |
3480 KiB |
| 02_Bob_00.txt |
AC |
7 ms |
3676 KiB |
| 02_Bob_01.txt |
AC |
7 ms |
3428 KiB |
| 02_Bob_02.txt |
AC |
7 ms |
3628 KiB |
| 02_Bob_03.txt |
AC |
7 ms |
3440 KiB |
| 02_Bob_04.txt |
AC |
7 ms |
3616 KiB |
| 02_Bob_05.txt |
AC |
7 ms |
3472 KiB |
| 02_Bob_06.txt |
AC |
7 ms |
3536 KiB |
| 02_Bob_07.txt |
AC |
6 ms |
3528 KiB |
| 02_Bob_08.txt |
AC |
9 ms |
3464 KiB |
| 03_Alice_00.txt |
AC |
7 ms |
3528 KiB |
| 03_Alice_01.txt |
AC |
7 ms |
3480 KiB |
| 03_Alice_02.txt |
AC |
7 ms |
3528 KiB |