結果
問題 | No.2 素因数ゲーム |
ユーザー |
![]() |
提出日時 | 2018-06-24 07:00:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 622 bytes |
コンパイル時間 | 1,013 ms |
コンパイル使用メモリ | 75,468 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 13:32:11 |
合計ジャッジ時間 | 2,012 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:21:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> using namespace std; typedef long long int ll; typedef pair<int, int> P; int main() { int n; scanf("%d", &n); vector<int> e; for(int i=2; i*i<=n; i++){ if(n%i!=0) continue; int e0=0; while(n%i==0){ n/=i; e0++; } e.push_back(e0); } if(n>1) e.push_back(1); int g=0; for(int i=0; i<e.size(); i++){ g^=e[i]; } if(g==0){ printf("Bob\n"); }else{ printf("Alice\n"); } return 0; }