結果
問題 | No.103 素因数ゲーム リターンズ |
ユーザー |
![]() |
提出日時 | 2024-07-29 21:48:49 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 612 bytes |
コンパイル時間 | 1,222 ms |
コンパイル使用メモリ | 92,116 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-29 21:48:51 |
合計ジャッジ時間 | 2,728 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
ソースコード
#include<iostream>#include<vector>#include<algorithm>using namespace std;using ll = long long;int main(){cin.tie(nullptr);ios::sync_with_stdio(false);int n,m;cin>>n;int now = 0;for(int i = 0;i<n;i++){int a;cin>>a;int res = a;for(int i = 2;i*i<=a;i++){if(res%i!=0) continue;int cnt = 0;while(res%i==0){res /= i;cnt++;}now ^= cnt % 3;}if(res!=1) now ^= 1;}if(now==0) cout<<"Bob\n";else cout<<"Alice\n";;}