結果
問題 | No.1665 quotient replace |
ユーザー |
![]() |
提出日時 | 2021-09-03 21:39:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 292 ms / 3,000 ms |
コード長 | 938 bytes |
コンパイル時間 | 1,778 ms |
コンパイル使用メモリ | 169,480 KB |
実行使用メモリ | 18,992 KB |
最終ジャッジ日時 | 2024-12-15 11:04:00 |
合計ジャッジ時間 | 8,491 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll,ll> P; typedef vector<ll> VI; typedef vector<VI> VVI; #define REP(i,n) for(ll i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() template<typename T> bool chmax(T &x, const T &y) {return (x<y)?(x=y,true):false;}; template<typename T> bool chmin(T &x, const T &y) {return (x>y)?(x=y,true):false;}; constexpr ll MOD=998244353; constexpr ll INF=2e18; const int M=1000000; int main(){ int n; cin >> n; VI a(n); REP(i,n) cin >> a[i]; VI p(M+1,0); for(int i=2;i<=M;i++){ if(p[i]==0){ ll pw=1; while(pw*i<=M){ pw=pw*i; for(ll j=pw;j<=M;j+=pw){ p[j]++; } } } } ll x=0; REP(i,n){ x=(x^p[a[i]]); } if(x!=0) cout << "white" << endl; else cout << "black" << endl; return 0; }