結果
| 問題 |
No.103 素因数ゲーム リターンズ
|
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2020-11-15 20:24:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 839 bytes |
| コンパイル時間 | 1,746 ms |
| コンパイル使用メモリ | 175,304 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-23 01:21:27 |
| 合計ジャッジ時間 | 2,867 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 5 |
| other | WA * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> M(N);
for (int i = 0; i < N; i++){
cin >> M[i];
}
vector<int> grundy(10001, 0);
for (int i = 2; i <= 10000; i++){
int num = i;
vector<int> p;
for (int j = 2; j * j <= num; j++){
if (num % j == 0){
p.push_back(j);
while (num % j == 0){
num /= j;
}
}
}
if (num > 1){
p.push_back(num);
}
set<int> st;
for (int j : p){
st.insert(grundy[i / j]);
if (i % (j * j) == 0){
st.insert(grundy[i / (j * j)]);
}
}
while (st.count(grundy[i])){
grundy[i]++;
}
}
int X = 0;
for (int i = 0; i < N; i++){
X ^= grundy[M[i]];
}
if (X == 0){
cout << "Alice" << endl;
} else {
cout << "Bob" << endl;
}
}
SSRS