結果
| 問題 |
No.1665 quotient replace
|
| コンテスト | |
| ユーザー |
🍮かんプリン
|
| 提出日時 | 2021-09-04 04:07:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 338 ms / 3,000 ms |
| コード長 | 764 bytes |
| コンパイル時間 | 1,256 ms |
| コンパイル使用メモリ | 160,480 KB |
| 実行使用メモリ | 11,648 KB |
| 最終ジャッジ日時 | 2024-12-16 04:19:48 |
| 合計ジャッジ時間 | 8,050 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
/**
* @FileName a.cpp
* @Author kanpurin
* @Created 2021.09.04 04:06:58
**/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
int n;cin >> n;
vector<int> a(1000001);
vector<int> spf(1000001);
vector<int> prime;
for (int d = 2; d <= 1000000; d++) {
if (a[d] == 0) {
a[d] = 1;
spf[d] = d;
prime.push_back(d);
}
for(int p : prime) {
if (p * d > 1000000 || p > spf[d]) break;
a[p*d] = a[d] + 1;
spf[p*d] = p;
}
}
int grundy = 0;
for (int i = 0; i < n; i++) {
int t;cin >> t;
grundy ^= a[t];
}
if (grundy == 0) puts("black");
else puts("white");
return 0;
}
🍮かんプリン