結果

問題 No.1716 Bonus Nim
ユーザー _san_yo_san_yo
提出日時 2021-10-22 23:35:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 1,682 ms
コンパイル使用メモリ 167,204 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 15:47:04
合計ジャッジ時間 6,296 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 194 ms
4,348 KB
testcase_05 AC 194 ms
4,348 KB
testcase_06 AC 196 ms
4,348 KB
testcase_07 AC 196 ms
4,348 KB
testcase_08 AC 194 ms
4,348 KB
testcase_09 AC 194 ms
4,348 KB
testcase_10 AC 195 ms
4,348 KB
testcase_11 AC 194 ms
4,348 KB
testcase_12 AC 194 ms
4,348 KB
testcase_13 AC 194 ms
4,348 KB
testcase_14 AC 194 ms
4,348 KB
testcase_15 AC 353 ms
4,348 KB
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;
typedef long long ll;

int main(){
    ll t,n,a,sum = 0;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> n;
        sum = 0;
        for(int j = 0; j < n; j++){
            cin >> a;
            sum = sum ^ a;
        }
        if(n % 2 == 1){
            cout << "Alice" << endl;
        }else{
            if(sum == 0){
                cout << "Bob" << endl;
            }else{
                cout << "Alice" << endl;
            }
        }
    }
}
0