結果

問題 No.2059 Odd Move Nim
ユーザー nawawannawawan
提出日時 2022-08-26 22:38:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 2,125 ms
コンパイル使用メモリ 201,792 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2024-04-22 00:44:26
合計ジャッジ時間 4,929 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    int l = 0, r = 0;
    set<int> s;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        s.insert(A[i]);
    }
    for(int i = 1; i < N; i++){
        if(i % 2 == 0) r ^= A[i];
        else l ^= A[i];
    }
    if(l % 2 == 0) {
        int cnt = 0;
        for(int i = 0; i < 29; i++){
            if(s.count(1 << i)) cnt++;
        }
        if(cnt >= 2) cout << "Alice" << endl;
        else cout << "Bob" << endl;
    }
    else {
        cout << "Alice" << endl;
    }
}
0