結果
問題 | No.2666 Decreasing Modulo Nim |
ユーザー |
![]() |
提出日時 | 2024-03-20 17:59:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 585 bytes |
コンパイル時間 | 747 ms |
コンパイル使用メモリ | 66,232 KB |
最終ジャッジ日時 | 2025-02-20 08:13:45 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 WA * 10 |
ソースコード
#include <iostream>using namespace std;typedef long long ll;ll a[200010];int main(){ll i,n,m; cin >> n >> m;for(i=0;i<n;i++) cin >> a[i];while(true){ll s1 = 0,s2 = 0;for(i=0;i<n;i++){ll b = a[i]/m;s1 ^= b;s2 += a[i];}if(!s2){cout << "Bob\n";return 0;}if(s1){cout << "Alice\n";return 0;}if(s2&1){cout << "Alice\n";return 0;}for(i=0;i<n;i++) a[i] /= 2;}}