結果

問題 No.1665 quotient replace
ユーザー monnumonnu
提出日時 2021-09-03 23:08:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 752 bytes
コンパイル時間 3,708 ms
コンパイル使用メモリ 227,424 KB
実行使用メモリ 11,140 KB
最終ジャッジ日時 2023-08-22 00:44:48
合計ジャッジ時間 10,244 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,996 KB
testcase_01 AC 11 ms
6,976 KB
testcase_02 AC 11 ms
7,072 KB
testcase_03 AC 11 ms
6,940 KB
testcase_04 AC 11 ms
7,064 KB
testcase_05 AC 11 ms
6,956 KB
testcase_06 AC 13 ms
7,068 KB
testcase_07 AC 11 ms
7,004 KB
testcase_08 AC 12 ms
6,952 KB
testcase_09 AC 19 ms
6,984 KB
testcase_10 AC 106 ms
8,224 KB
testcase_11 AC 224 ms
9,948 KB
testcase_12 AC 34 ms
7,168 KB
testcase_13 AC 293 ms
11,000 KB
testcase_14 AC 291 ms
11,012 KB
testcase_15 AC 291 ms
10,920 KB
testcase_16 AC 291 ms
11,140 KB
testcase_17 AC 291 ms
10,948 KB
testcase_18 AC 11 ms
6,952 KB
testcase_19 AC 11 ms
7,240 KB
testcase_20 AC 11 ms
7,004 KB
testcase_21 AC 11 ms
6,984 KB
testcase_22 AC 11 ms
6,944 KB
testcase_23 AC 11 ms
7,220 KB
testcase_24 AC 11 ms
6,936 KB
testcase_25 AC 11 ms
6,996 KB
testcase_26 AC 12 ms
7,216 KB
testcase_27 AC 13 ms
6,992 KB
testcase_28 AC 20 ms
7,484 KB
testcase_29 AC 30 ms
7,172 KB
testcase_30 AC 154 ms
9,092 KB
testcase_31 AC 231 ms
10,368 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 11 ms
7,000 KB
testcase_43 AC 11 ms
6,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<pair<int,int>>>;
#define MAX 100000
#define MOD 1000000007
#define INF 1000000000000000000

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }

  int M=1000000;
  vector<int> grundy(M+1,0);
  for(int i=2;i*i<=M;i++){
    if(grundy[i]==0){
      for(int d=i;d<=M;d*=i){
        for(int j=d;j<=M;j+=d){
          grundy[j]++;
        }
      }
    }
  }
  for(int i=1001;i<=M;i++){
    if(grundy[i]==0){
      grundy[i]++;
    }
  }

  int x=0;
  for(int i=0;i<N;i++){
    x^=grundy[A[i]];
  }
  if(x==0){
    cout<<"black"<<'\n';
  }else{
    cout<<"white"<<'\n';
  }
}
0