結果
問題 | No.2 素因数ゲーム |
ユーザー |
![]() |
提出日時 | 2014-11-17 20:37:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 547 bytes |
コンパイル時間 | 686 ms |
コンパイル使用メモリ | 71,764 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 10:46:41 |
合計ジャッジ時間 | 1,853 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include <iostream> #include <vector> #include <cstdio> #include <sstream> #include <map> #include <string> #include <algorithm> #include <queue> #include <cmath> using namespace std; long long divisors(long long N){ long long ret = 0; for(long long i=2; i*i<=N; i++){ long long tmp = 0; while(N%i==0){ tmp++; N/=i; } ret ^= tmp; } if(N!=1){ ret ^= 1; } return ret; } int main(){ long long n; cin >> n; long long ans = divisors(n); cout << (ans==0?"Bob":"Alice") << endl; return 0; }