結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
cormoran
|
| 提出日時 | 2016-09-13 21:22:53 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 174 ms / 5,000 ms |
| コード長 | 583 bytes |
| 記録 | |
| コンパイル時間 | 1,047 ms |
| コンパイル使用メモリ | 173,984 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-01 09:54:26 |
| 合計ジャッジ時間 | 2,568 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
class Solver {
public:
bool solve() {
int n; cin >> n;
int grundy = 0;
for(int i = 2; n > 1; i++) {
int cnt = 0;
while(n % i == 0) {
n /= i;
cnt++;
}
grundy ^= cnt;
}
cout << (grundy != 0 ? "Alice" : "Bob") << endl;
return 0;
}
};
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
Solver s;
s.solve();
return 0;
}
cormoran