結果

問題 No.2059 Odd Move Nim
ユーザー marc2825
提出日時 2022-08-26 23:34:08
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 66,540 KB
最終ジャッジ日時 2025-01-31 05:49:41
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

//「Nim」に必勝法が存在することを把握しておく

#include <iostream>

using namespace std;

using ll = long long;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)


int main(){
    int N; cin >> N;
    ll xoreve = 0;
    rep(i,N){
        ll a; cin >> a;
        
        if((i+1) % 2 == 0) xoreve ^= a;
    }
    

    if(xoreve != 0) cout << "Alice" << endl;
    else cout << "Bob" << endl;

}
0