結果
問題 | No.1665 quotient replace |
ユーザー |
|
提出日時 | 2021-09-14 15:57:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 480 ms / 3,000 ms |
コード長 | 1,048 bytes |
コンパイル時間 | 1,936 ms |
コンパイル使用メモリ | 194,380 KB |
最終ジャッジ日時 | 2025-01-24 13:54:11 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
ソースコード
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #include <iostream> #include <algorithm> using namespace std; using ll = long long; using pii = pair<int,int>; using pll = pair<ll,ll>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using vb = vector<bool>; using vvb = vector<vb>; using vpi = vector<pii>; using vvpi = vector<vpi>; using vpl = vector<pll>; using vvpl = vector<vpl>; const int inf = 1 << 30; const ll INF = 1LL << 60; #define rep(i,m,n) for (int i = m; i < (int)(n); i++) #define rrep(i,m,n) for (int i = m; i > (int)(n); i--) int main(){ int M = 1000001; int n; cin >> n; vi P(M,0); P[1] = 1; for (int i = 2;i < M;i++){ for (int j = i;j < M; j += i){ if (P[j] == 0) P[j] = i; } } int judge = 0; rep(i,0,n){ int a,x = 0; cin >> a; while (a > 1){ a /= P[a]; ++x; } judge ^= x; } if (judge != 0) cout << "white" << endl; else cout << "black" << endl; }