結果

問題 No.1716 Bonus Nim
ユーザー たたき@競プロたたき@競プロ
提出日時 2023-08-26 06:53:04
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 764 bytes
コンパイル時間 6,219 ms
コンパイル使用メモリ 305,776 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-26 06:53:16
合計ジャッジ時間 11,788 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint=modint998244353; //1000000007;
using ll=long long;
using pp=pair<int,int>;
#define sr string 
#define vc vector
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define pque priority_queue
#define bpc(a) __builtin_popcount(a)
sr al="Alice";
sr bob="Bob";
void sol(){
 int n;cin>>n;
 vc<int>v(n); rep(i,n)cin>>v[i];
 if(n&1){
   cout<<al<<"\n";
   return;
 }
 int od=0; rep(i,n)if(v[i]&1)od++;
 ll tw=0; rep(i,n)tw+=(v[i]+1)/2-1;
 if(od&1)cout<<al<<"\n";
 else {
   if(tw%2==0)cout<<bob<<"\n";
   else cout<<al<<"\n";
 }
 return;
}
int main(){
  int t;cin>>t;
  rep(i,t)sol();
}
0