結果

問題 No.1665 quotient replace
ユーザー Nzt3Nzt3
提出日時 2021-09-03 22:06:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 472 ms / 3,000 ms
コード長 485 bytes
コンパイル時間 1,840 ms
コンパイル使用メモリ 166,992 KB
実行使用メモリ 7,296 KB
最終ジャッジ日時 2024-05-09 04:12:21
合計ジャッジ時間 9,709 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
7,088 KB
testcase_01 AC 10 ms
7,168 KB
testcase_02 AC 10 ms
7,184 KB
testcase_03 AC 11 ms
7,120 KB
testcase_04 AC 10 ms
7,168 KB
testcase_05 AC 10 ms
7,056 KB
testcase_06 AC 13 ms
7,272 KB
testcase_07 AC 11 ms
7,168 KB
testcase_08 AC 11 ms
7,168 KB
testcase_09 AC 22 ms
7,168 KB
testcase_10 AC 162 ms
7,168 KB
testcase_11 AC 362 ms
7,296 KB
testcase_12 AC 45 ms
7,168 KB
testcase_13 AC 468 ms
7,168 KB
testcase_14 AC 472 ms
7,296 KB
testcase_15 AC 455 ms
7,092 KB
testcase_16 AC 453 ms
7,168 KB
testcase_17 AC 447 ms
7,168 KB
testcase_18 AC 10 ms
7,156 KB
testcase_19 AC 10 ms
7,156 KB
testcase_20 AC 10 ms
7,128 KB
testcase_21 AC 10 ms
7,092 KB
testcase_22 AC 10 ms
7,168 KB
testcase_23 AC 10 ms
7,056 KB
testcase_24 AC 11 ms
7,088 KB
testcase_25 AC 10 ms
7,080 KB
testcase_26 AC 10 ms
7,168 KB
testcase_27 AC 14 ms
7,168 KB
testcase_28 AC 22 ms
7,168 KB
testcase_29 AC 34 ms
7,168 KB
testcase_30 AC 189 ms
7,168 KB
testcase_31 AC 279 ms
7,168 KB
testcase_32 AC 345 ms
7,168 KB
testcase_33 AC 138 ms
7,168 KB
testcase_34 AC 280 ms
7,060 KB
testcase_35 AC 246 ms
7,168 KB
testcase_36 AC 266 ms
7,124 KB
testcase_37 AC 235 ms
7,168 KB
testcase_38 AC 279 ms
7,164 KB
testcase_39 AC 199 ms
7,260 KB
testcase_40 AC 211 ms
7,196 KB
testcase_41 AC 211 ms
7,168 KB
testcase_42 AC 10 ms
7,128 KB
testcase_43 AC 10 ms
7,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  int ans=0;
  vector<int>diver(1000005);
  iota(diver.begin(),diver.end(),0);
  for(long long i=2;i<1000005;i++){
    if(diver[i]!=i)continue;
    for(long long j=i*i;j<1000005;j+=i){
      diver[j]=i;
    }
  }
  for(int i=0,A;i<N;i++){
    cin>>A;
    int cnt=0;
    while(A!=1){
      cnt++;
      A/=diver[A];
    }
    ans^=cnt;
  }
  if(ans==0){
    cout<<"black\n";
  }else{
    cout<<"white\n";
  }
}
0