結果

問題 No.2059 Odd Move Nim
ユーザー 👑 Nachia
提出日時 2024-04-26 02:07:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 762 ms
コンパイル使用メモリ 74,244 KB
最終ジャッジ日時 2025-02-21 09:04:28
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(int)(n); i++)

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N; cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    int grundy = 0;
    for(int i=1; i<N; i+=2) grundy ^= A[i];
    if(grundy == 0) cout << "Bob\n"; else cout << "Alice\n";
    return 0;
}
0