結果
| 問題 | No.2666 Decreasing Modulo Nim |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-08 21:16:52 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 13 ms / 2,000 ms |
| + 151µs | |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 75,008 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-06 05:44:11 |
| 合計ジャッジ時間 | 4,781 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 55 |
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
int N,M,A[2<<17];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>N>>M;
int X=0;
for(int i=0;i<N;i++)
{
cin>>A[i];
X^=A[i]/M;
A[i]%=M;
}
if(X!=0)
{
cout<<"Alice\n";
return 0;
}
while(true)
{
long long sum=0;
for(int i=0;i<N;i++)
{
sum+=A[i];
A[i]/=2;
}
if(sum%2==1)
{
cout<<"Alice\n";
return 0;
}
if(sum==0)break;
}
cout<<"Bob\n";
}