結果
問題 | No.1665 quotient replace |
ユーザー |
👑 ![]() |
提出日時 | 2021-09-03 21:26:35 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 163 ms / 3,000 ms |
コード長 | 747 bytes |
コンパイル時間 | 6,058 ms |
コンパイル使用メモリ | 147,556 KB |
最終ジャッジ日時 | 2025-01-24 04:44:38 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;