結果
問題 |
No.2813 Cookie
|
ユーザー |
![]() |
提出日時 | 2024-07-19 23:00:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 1,059 bytes |
コンパイル時間 | 3,776 ms |
コンパイル使用メモリ | 228,272 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 23:01:05 |
合計ジャッジ時間 | 5,385 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define rep(i,n) for(int i = 0; i < n; i++) #define all(a) a.begin(),a.end() #define SORT(a) sort(all(a)); #define MIN(a) *min_element(all(a)) #define MAX(a) *max_element(all(a)) #define SUM(a) accumulate(all(a),0LL) using ll=long long; using ld=long double; using ull=unsigned long; ll MOD=998244353; ll inf=1e15; using mint = static_modint<998244353>; int main(){ cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); ll T;cin>>T; /*vector<ll>grundy(200001); grundy[1]=1; grundy[2]=1; grundy[3]=2; for(ll i=1;i<=2*1e5;i++){ if(i%3==1){grundy[i]=(i/3)*4-2;} else{grundy[i]=((i-1)/3)*4;} }*/ while(T--){ ll n;cin>>n; ll ans=0; rep(i,n){ ll a;cin>>a; ll grundy; if(a==1){grundy=1;} else if(a==2){grundy=1;} else if(a==3){grundy=2;} else if(a%3!=1){grundy=((a-1)/3)*4;} else{grundy=((a-1)/3)*4-2;} ans=ans^grundy; } if(ans!=0)cout<<"Alice"<<endl; else{cout<<"Bob"<<endl;} } }