結果
問題 | No.2059 Odd Move Nim |
ユーザー |
![]() |
提出日時 | 2025-03-29 07:01:28 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 790 bytes |
コンパイル時間 | 3,764 ms |
コンパイル使用メモリ | 273,584 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-29 07:01:34 |
合計ジャッジ時間 | 5,840 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 WA * 4 |
ソースコード
#include <bits/stdc++.h>//#include <atcoder/modint>using namespace std;//using namespace atcoder;using ll = long long;//using mint = modint998244353;int main(){cin.tie(nullptr);ios_base::sync_with_stdio(false);/*i番目の山の1つの石のgrundy数を考える。0のgrundy数が1で奇数番目からは偶数番目にしか遷移できないのでgrundy数(mex)は1偶数番目からは奇数番目にしか遷移できないのでgrundy数(mex)は0よって奇数番目の山だけのgrundy数を見れば良い。*/ll N, A, g=0;cin >> N;for (int i=0; i<N; i++){cin >> A;if (i % 2 == 1 && A % 2 == 1) g ^= 1;}cout << (g == 0 ? "Bob" : "Alice") << endl;return 0;}