結果

問題 No.1716 Bonus Nim
ユーザー umezoumezo
提出日時 2021-10-22 23:23:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 3,546 ms
コンパイル使用メモリ 202,444 KB
実行使用メモリ 5,540 KB
最終ジャッジ日時 2023-10-24 15:28:48
合計ジャッジ時間 4,732 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 57 ms
4,524 KB
testcase_05 AC 57 ms
5,540 KB
testcase_06 AC 57 ms
5,024 KB
testcase_07 AC 58 ms
5,500 KB
testcase_08 AC 57 ms
4,768 KB
testcase_09 AC 57 ms
4,796 KB
testcase_10 AC 58 ms
5,004 KB
testcase_11 AC 57 ms
4,636 KB
testcase_12 AC 57 ms
4,964 KB
testcase_13 AC 57 ms
5,136 KB
testcase_14 AC 56 ms
4,372 KB
testcase_15 AC 313 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,688 KB
testcase_23 AC 56 ms
4,616 KB
testcase_24 AC 56 ms
4,884 KB
testcase_25 AC 56 ms
4,688 KB
testcase_26 AC 58 ms
4,688 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){
      if(A[i]==1) continue;
      ans^=(A[i]-1);
    }
    if(ans==0) cout<<"Bob"<<endl;
    else cout<<"Alice"<<endl;
  }
  
  return 0;
}
0