結果
| 問題 |
No.103 素因数ゲーム リターンズ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-14 23:53:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 409 bytes |
| コンパイル時間 | 1,890 ms |
| コンパイル使用メモリ | 157,916 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 21:10:08 |
| 合計ジャッジ時間 | 2,074 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int grundy(int M){
int res = 0;
for(int p=2;p<=M;p++)if(M % p == 0){
int e = 0;
while(M % p == 0){
M /= p;
++e;
}
res ^= e % 3;
}
return res;
}
int main(){
int N;
cin >> N;
int res = 0;
for(int i=0;i<N;i++){
int M;
cin >> M;
res ^= grundy(M);
}
cout << (res ? "Alice" : "Bob") << endl;
return 0;
}