結果

問題 No.2059 Odd Move Nim
ユーザー butsurizukibutsurizuki
提出日時 2022-08-26 22:21:37
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 1,151 bytes
コンパイル時間 2,660 ms
コンパイル使用メモリ 243,752 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-05 14:00:48
合計ジャッジ時間 4,781 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,384 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 75 ms
4,384 KB
testcase_13 AC 74 ms
4,380 KB
testcase_14 AC 73 ms
4,384 KB
testcase_15 AC 74 ms
4,380 KB
testcase_16 AC 74 ms
4,380 KB
testcase_17 AC 73 ms
4,388 KB
testcase_18 AC 73 ms
4,384 KB
testcase_19 AC 74 ms
4,384 KB
testcase_20 AC 74 ms
4,384 KB
testcase_21 AC 72 ms
4,384 KB
testcase_22 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
//
// map<vector<int>,int> mp;
// int f(vector<int> a){
//   if(mp.find(a)!=mp.end()){return mp[a];}
//   int cur=-1;
//   for(int i=1;cur==-1 && i<a.size();i++){
//     for(int j=1;cur==-1 && j<=i;j+=2){
//       vector<int> b=a;
//       while(b[i]>0){
//         b[i]--;
//         b[i-j]++;
//         if(f(b)==-1){cur=1;break;}
//       }
//     }
//   }
//   mp[a]=cur;
//   return cur;
// }
//
// void rep(int n,int m,vector<int> &a){
//   if(n==0){
//     f(a);
//     return;
//   }
//   for(int i=0;i<=m;i++){
//     a.push_back(i);
//     rep(n-1,m-i,a);
//     a.pop_back();
//   }
// }
//
// int main(){
//   int n,m;
//   cin >> n >> m;
//   vector<int> ini={};
//   rep(n,m,ini);
//
//   for(auto &nx : mp){
//     if(nx.second==-1){
//       for(auto &ny : nx.first){cout << ny << " ";}
//       cout << "\n";
//     }
//   }
//   return 0;
// }

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(auto &nx : a){cin >> nx;}
  int g=0;
  for(int i=1;i<n;i+=2){
    g^=a[i];
  }
  if(g==0){cout << "Bob\n";}
  else{cout << "Alice\n";}
  return 0;
}
// Sorry, I don't like this task.
0