結果

問題 No.2813 Cookie
ユーザー nouka28nouka28
提出日時 2024-07-19 21:53:56
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 246,424 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 21:54:05
合計ジャッジ時間 5,509 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define int long long

void slv(){
    int n;cin>>n;
    vector<int> a(n);for(auto&&e:a)cin>>e;
    int g=0;
    for(auto&&e:a){
        if(e<=4){
            g^=(e+1)/2;
        }else{
            e-=5;
            g^=4+4*(e/3)+(e%3==2)*2;
        }
    }
    if(g)cout<<"Alice"<<endl;
    else cout<<"Bob"<<endl;
}

signed main(){
    int t;cin>>t;
    while(t--){
        slv();
    }
}
0