結果
問題 | No.2 素因数ゲーム |
ユーザー |
|
提出日時 | 2021-01-19 15:03:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 649 bytes |
コンパイル時間 | 1,054 ms |
コンパイル使用メモリ | 81,068 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-16 09:37:07 |
合計ジャッジ時間 | 1,565 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<string> #include<algorithm> #include<vector> #include<queue> #include<map> using namespace std; typedef long long LL; const int MR=1e6+10; int k[1000],cnt=0; int main(){ int n; cin>>n; for(int i=2;i*i<=n;i++){ if(n%i!=0) continue; cnt++; while(n%i==0){ k[cnt]++; n/=i; } } if(n>1){ cnt++; k[cnt]=1; } int ans=0; for(int i=1;i<=cnt;i++){ ans ^= k[i]; } if(ans){ printf("Alice\n"); } else{ printf("Bob\n"); } return 0; }