結果
問題 | No.103 素因数ゲーム リターンズ |
ユーザー |
|
提出日時 | 2022-05-04 12:34:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 22 ms / 5,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 4,349 ms |
コンパイル使用メモリ | 250,756 KB |
最終ジャッジ日時 | 2025-01-29 02:18:32 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
ソースコード
#include<bits/stdc++.h> using namespace std; #include<atcoder/all> using namespace atcoder; using ll = long long; int n; vector<int> m; void solve(){ int g = 0; for(int i = 0;i<n;i++){ for(int j = 2;j<=m[i];j++){ int t = 0; while(m[i]%j==0){ t++; m[i]/=j; } t%=3; g ^= t; } } if(g)cout<<"Alice"<<endl; else cout<<"Bob"<<endl; } signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cin >> n; m = vector<int>(n); for(auto &i:m)cin >> i; solve(); }