結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
moti
|
| 提出日時 | 2020-03-08 15:01:19 |
| 言語 | C++17(clang) (17.0.6 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 417 bytes |
| 記録 | |
| コンパイル時間 | 1,665 ms |
| コンパイル使用メモリ | 162,112 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-30 16:52:16 |
| 合計ジャッジ時間 | 2,683 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
int main() {
int N; cin >> N;
ll nim = 0;
for(int i=2;i*i<=N;i++) {
ll cnt = 0;
while(N % i == 0) {
cnt ++;
N /= i;
}
nim ^= cnt;
}
if(N > 1) {
nim ^= 1;
}
if(nim==0) { cout << "Bob\n"; }
else { cout << "Alice\n"; }
return 0;
}
moti