結果
問題 | No.103 素因数ゲーム リターンズ |
ユーザー |
![]() |
提出日時 | 2021-10-26 15:32:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 489 bytes |
コンパイル時間 | 4,410 ms |
コンパイル使用メモリ | 251,060 KB |
最終ジャッジ日時 | 2025-01-25 07:15:30 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000 int get(int n){ int ret = 0; for(int i=2;i<=n;i++){ int c = 0; while(n%i==0){ n/=i; c++; } ret ^= c%3; } return ret; } int main(){ int N; cin>>N; int t = 0; rep(i,N){ int m; cin>>m; t ^= get(m); } if(t==0)cout<<"Bob"<<endl; else cout<<"Alice"<<endl; return 0; }