結果
| 問題 |
No.2666 Decreasing Modulo Nim
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-08 22:44:41 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 424 bytes |
| コンパイル時間 | 3,042 ms |
| コンパイル使用メモリ | 247,008 KB |
| 実行使用メモリ | 13,636 KB |
| 最終ジャッジ日時 | 2024-09-29 20:11:54 |
| 合計ジャッジ時間 | 7,282 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 -- * 53 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
int n,m;
cin>>n>>m;
vector<int> a(n);
for(int i=0;i<n;i++)cin>>a[i];
int x=0;
for(int i=0;i<n;i++)x^=a[i]/m;
if(x)cout<<"Alice"<<endl,exit(0);
for(int i=0;i<n;i++)a[i]%=m;
while(1){
ll r=0;
for(int i=0;i<n;i++)r+=a[i];
if(r&1)cout<<"Alice"<<endl;
else if(r==0)break;
else for(int i=0;i<n;i++)a[i]/=2;
}
cout<<"Bob"<<endl;
}