結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
motxx
|
| 提出日時 | 2014-10-08 18:13:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 443 bytes |
| コンパイル時間 | 1,997 ms |
| コンパイル使用メモリ | 157,020 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 10:36:00 |
| 合計ジャッジ時間 | 3,157 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
motxx