結果
| 問題 | No.1665 quotient replace |
| コンテスト | |
| ユーザー |
👑 Nachia
|
| 提出日時 | 2021-09-03 21:26:35 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 3,000 ms |
| コード長 | 747 bytes |
| 記録 | |
| コンパイル時間 | 1,670 ms |
| コンパイル使用メモリ | 116,204 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-06-22 23:21:20 |
| 合計ジャッジ時間 | 5,528 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <atcoder/string>
#include <atcoder/segtree>
using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
int Z = 1000000;
vector<int> sieve(Z+1,0);
for(i64 p=2; p<=Z; p++) if(sieve[p] == 0){
for(i64 i=0; i*p<=Z; i++) sieve[i*p] = sieve[i] + 1;
}
int N; cin >> N;
i64 ans = 0;
rep(i,N){
int a; cin >> a;
ans ^= sieve[a];
}
if(ans == 0) cout << "black" << endl;
else cout << "white" << endl;
return 0;
}
struct ios_do_not_sync{
ios_do_not_sync(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
} ios_do_not_sync_instance;
Nachia