結果
問題 | No.1665 quotient replace |
ユーザー | kabipoyo |
提出日時 | 2022-01-04 02:40:24 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,778 bytes |
コンパイル時間 | 4,988 ms |
コンパイル使用メモリ | 256,984 KB |
実行使用メモリ | 27,008 KB |
最終ジャッジ日時 | 2024-04-21 17:03:04 |
合計ジャッジ時間 | 15,339 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
11,524 KB |
testcase_01 | AC | 15 ms
11,080 KB |
testcase_02 | AC | 14 ms
11,284 KB |
testcase_03 | AC | 15 ms
11,488 KB |
testcase_04 | AC | 15 ms
11,292 KB |
testcase_05 | AC | 14 ms
11,340 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 18 ms
11,344 KB |
testcase_09 | AC | 30 ms
11,728 KB |
testcase_10 | AC | 215 ms
16,692 KB |
testcase_11 | AC | 457 ms
23,140 KB |
testcase_12 | AC | 59 ms
12,688 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 619 ms
27,008 KB |
testcase_18 | AC | 17 ms
11,488 KB |
testcase_19 | AC | 17 ms
11,320 KB |
testcase_20 | AC | 15 ms
11,412 KB |
testcase_21 | AC | 16 ms
11,384 KB |
testcase_22 | AC | 16 ms
11,392 KB |
testcase_23 | AC | 15 ms
11,520 KB |
testcase_24 | AC | 17 ms
11,340 KB |
testcase_25 | AC | 16 ms
11,488 KB |
testcase_26 | AC | 17 ms
11,264 KB |
testcase_27 | AC | 19 ms
11,452 KB |
testcase_28 | AC | 31 ms
11,520 KB |
testcase_29 | AC | 46 ms
12,596 KB |
testcase_30 | AC | 223 ms
19,072 KB |
testcase_31 | AC | 344 ms
23,168 KB |
testcase_32 | WA | - |
testcase_33 | AC | 178 ms
15,360 KB |
testcase_34 | WA | - |
testcase_35 | AC | 339 ms
19,328 KB |
testcase_36 | WA | - |
testcase_37 | AC | 323 ms
18,944 KB |
testcase_38 | AC | 392 ms
20,644 KB |
testcase_39 | AC | 259 ms
17,840 KB |
testcase_40 | AC | 289 ms
17,836 KB |
testcase_41 | AC | 265 ms
17,792 KB |
testcase_42 | WA | - |
testcase_43 | WA | - |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; typedef int64_t lint; #define rep(i, n) for(int i=0; i<n; i++) #define repx(i, l, n) for(int i=l; i<n; i++) #define all(v) v.begin(), v.end() #define show(x) cout << #x << ": " << x << endl; #define list(x) cout << #x << ": " << x << " "; #define pb push_back using vi = vector<lint>; using vvi = vector<vector<lint>>; template<class T> inline void vin(vector<T>& v) { rep(i, v.size()) cin >> v.at(i); } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template<class T> inline void drop(T x) { cout << x << endl; exit(0); } template<class T> void vout(vector<T> v) { rep(i, v.size()) { cout << v.at(i) << ' '; } cout << endl; } constexpr lint LINF = LLONG_MAX/2; struct Sieve { int n; vector<lint> p; Sieve(int n=1):n(n), p(n+1) { p.at(0) = -1, p.at(1) = -1; for(lint i=2; i<=n; i++) { if(!p.at(i)) { p.at(i) = i; for(lint j=i*i; j<=n; j+=i) { if (!p.at(j)) p.at(j) = i; } } } } bool isPrime(int x) { return p.at(x) == x;} vector<lint> factorList(int x) { vector<lint> v; while (x != 1) { v.push_back(p.at(x)); x /= p.at(x); } return v; } vector<lint> factor(int x) { vector<lint> v; while (x != 1) { int t = p.at(x); v.push_back(t); while (x % t == 0) x /= t; } return v; } }; int main() { lint N; cin >> N; vi v(N), w(N); vin(v); lint a=0, b=0, c=0, x, y, z; Sieve S(1001001); rep(i, N) { if (v[i] == 1) continue; w[i] = S.factorList(v[i]).size(); } rep(i, N) { a ^= w[i]; } rep(i, N) { if (w[i] == a) drop("white"); } std::cout << "black" << '\n'; }