結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
ふーらくたる
|
| 提出日時 | 2016-07-12 10:58:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 581 bytes |
| コンパイル時間 | 713 ms |
| コンパイル使用メモリ | 65,876 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 12:34:59 |
| 合計ジャッジ時間 | 1,673 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
#include <iostream>
#include <map>
using namespace std;
map<int, int> PrimeFactorization(int n) {
map<int, int> res;
for (int i = 2; i * i <= n; i++) {
while (n % i == 0) {
res[i]++;
n /= i;
}
}
if (n != 1) res[n]++;
return res;
}
int N;
int main() {
cin >> N;
map<int, int> factors = PrimeFactorization(N);
int x = 0;
for (auto it = factors.begin(); it != factors.end(); it++) {
x ^= it->second;
}
if (x != 0) cout << "Alice" << endl;
else cout << "Bob" << endl;
return 0;
}
ふーらくたる