結果

問題 No.1665 quotient replace
ユーザー eSeFeSeF
提出日時 2021-09-14 21:53:26
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 6,788 ms
コンパイル使用メモリ 149,572 KB
実行使用メモリ 11,080 KB
最終ジャッジ日時 2023-09-09 20:54:13
合計ジャッジ時間 15,684 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
10,968 KB
testcase_01 AC 21 ms
10,964 KB
testcase_02 AC 20 ms
10,868 KB
testcase_03 WA -
testcase_04 AC 21 ms
10,908 KB
testcase_05 AC 20 ms
10,912 KB
testcase_06 AC 24 ms
10,928 KB
testcase_07 AC 22 ms
10,972 KB
testcase_08 AC 23 ms
10,972 KB
testcase_09 AC 33 ms
10,984 KB
testcase_10 AC 156 ms
10,896 KB
testcase_11 AC 311 ms
10,896 KB
testcase_12 AC 52 ms
10,912 KB
testcase_13 AC 394 ms
10,936 KB
testcase_14 AC 392 ms
10,916 KB
testcase_15 AC 394 ms
10,880 KB
testcase_16 AC 397 ms
10,860 KB
testcase_17 AC 421 ms
10,980 KB
testcase_18 AC 21 ms
10,908 KB
testcase_19 AC 21 ms
10,952 KB
testcase_20 AC 21 ms
10,884 KB
testcase_21 AC 22 ms
10,832 KB
testcase_22 WA -
testcase_23 AC 21 ms
10,908 KB
testcase_24 AC 21 ms
10,884 KB
testcase_25 WA -
testcase_26 AC 21 ms
10,868 KB
testcase_27 AC 24 ms
10,908 KB
testcase_28 AC 33 ms
10,912 KB
testcase_29 AC 44 ms
10,964 KB
testcase_30 AC 192 ms
10,884 KB
testcase_31 AC 278 ms
10,888 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 207 ms
10,864 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 184 ms
10,984 KB
testcase_42 AC 21 ms
10,888 KB
testcase_43 AC 21 ms
10,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
int main(){
  int N;
  cin >> N;
  int M = 1000000;
  vector<int>C(M+1,0);
  for(int i=0;i<N;i++){
    int a;cin >> a;
    C[a]^=1;
  }
  vector<int>p(M+1,1);
  int g = 0;
  for(int i=2;i<=M;i++){
    if(p[i]==0)continue;
    for(int j=2*i;j<=M;j+=i){
      p[j] = 0;
    }
    for(int j=i;j<=M;j+=i){
      if(C[j]==0)continue;
      int y = j, c = 0;
      while(y%i==0)y/=i,c++;
      g^=c;
    }
  }
  cout << (g?"white":"black") << endl;
  return 0;
}
0