結果

問題 No.1716 Bonus Nim
ユーザー umezoumezo
提出日時 2021-10-22 23:22:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 1,985 ms
コンパイル使用メモリ 204,084 KB
実行使用メモリ 5,560 KB
最終ジャッジ日時 2023-10-24 15:26:42
合計ジャッジ時間 4,689 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 57 ms
4,544 KB
testcase_05 AC 57 ms
5,560 KB
testcase_06 AC 57 ms
5,044 KB
testcase_07 AC 57 ms
5,520 KB
testcase_08 AC 57 ms
4,788 KB
testcase_09 AC 56 ms
4,816 KB
testcase_10 AC 57 ms
5,024 KB
testcase_11 AC 57 ms
4,640 KB
testcase_12 AC 58 ms
4,984 KB
testcase_13 AC 57 ms
5,140 KB
testcase_14 AC 56 ms
4,372 KB
testcase_15 AC 301 ms
4,348 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 WA -
testcase_20 AC 2 ms
4,348 KB
testcase_21 WA -
testcase_22 AC 57 ms
4,708 KB
testcase_23 AC 56 ms
4,620 KB
testcase_24 AC 57 ms
4,904 KB
testcase_25 AC 58 ms
4,708 KB
testcase_26 AC 57 ms
4,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int t;
  cin>>t;
  while(t--){
    int n;
    cin>>n;
    vector<ll> A(n);
    rep(i,n) cin>>A[i];
    
    if(n%2==1){
      cout<<"Alice"<<endl;
      continue;
    }
    
    ll ans=0;
    rep(i,n) ans^=(A[i]-1);
    if(ans==0) cout<<"Bob"<<endl;
    else cout<<"Alice"<<endl;
  }
  
  return 0;
}
0