結果

問題 No.1665 quotient replace
ユーザー hourenhouren
提出日時 2021-12-06 15:52:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 782 bytes
コンパイル時間 1,588 ms
コンパイル使用メモリ 172,232 KB
実行使用メモリ 7,484 KB
最終ジャッジ日時 2023-09-21 15:33:50
合計ジャッジ時間 15,900 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
7,136 KB
testcase_01 AC 31 ms
7,156 KB
testcase_02 AC 31 ms
7,156 KB
testcase_03 AC 32 ms
7,236 KB
testcase_04 AC 32 ms
7,204 KB
testcase_05 AC 31 ms
7,240 KB
testcase_06 WA -
testcase_07 AC 32 ms
7,140 KB
testcase_08 AC 35 ms
7,152 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 485 ms
7,148 KB
testcase_12 WA -
testcase_13 AC 634 ms
7,380 KB
testcase_14 AC 618 ms
7,240 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 31 ms
7,132 KB
testcase_19 AC 32 ms
7,136 KB
testcase_20 AC 31 ms
7,156 KB
testcase_21 AC 32 ms
7,472 KB
testcase_22 AC 31 ms
7,160 KB
testcase_23 AC 32 ms
7,480 KB
testcase_24 AC 32 ms
7,140 KB
testcase_25 AC 31 ms
7,240 KB
testcase_26 AC 33 ms
7,296 KB
testcase_27 AC 36 ms
7,372 KB
testcase_28 AC 55 ms
7,204 KB
testcase_29 AC 75 ms
7,472 KB
testcase_30 AC 337 ms
7,152 KB
testcase_31 AC 503 ms
7,292 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 370 ms
7,296 KB
testcase_35 WA -
testcase_36 AC 354 ms
7,236 KB
testcase_37 AC 348 ms
7,152 KB
testcase_38 AC 413 ms
7,132 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 32 ms
7,132 KB
testcase_43 AC 32 ms
7,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()

int main(){
    int MAX_N = 1001001;
    vector<bool> PNJudge(MAX_N,true);
    set<int> pn;
    PNJudge[1] = false;
    for(int i=2;i<MAX_N;i++){
        if(!PNJudge[i]) continue;
        pn.insert(i);
        for(int j=i*2;j<MAX_N;j+=i) PNJudge[j] = false;
    }
    int n;
    cin >> n;
    int pncnt = 0, compcnt = 0;
    rep(i,n){
        int a;
        cin >> a;
        if(pn.count(a)) pncnt++;
        else if(a!=1) compcnt++;
    }
    bool ans;
    if(compcnt) ans = (compcnt & 1);
    else ans = (pncnt & 1);
    if(ans) cout << "white" << endl;
    else cout << "black" << endl;
    return 0;
}
0