結果

問題 No.1665 quotient replace
ユーザー karinohitokarinohito
提出日時 2021-09-03 23:06:49
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 580 ms / 3,000 ms
コード長 826 bytes
コンパイル時間 1,459 ms
コンパイル使用メモリ 166,988 KB
実行使用メモリ 10,860 KB
最終ジャッジ日時 2023-08-22 00:38:22
合計ジャッジ時間 11,428 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
10,528 KB
testcase_01 AC 15 ms
10,704 KB
testcase_02 AC 15 ms
10,848 KB
testcase_03 AC 14 ms
10,580 KB
testcase_04 AC 14 ms
10,592 KB
testcase_05 AC 15 ms
10,760 KB
testcase_06 AC 18 ms
10,640 KB
testcase_07 AC 15 ms
10,656 KB
testcase_08 AC 16 ms
10,608 KB
testcase_09 AC 29 ms
10,832 KB
testcase_10 AC 205 ms
10,596 KB
testcase_11 AC 440 ms
10,772 KB
testcase_12 AC 58 ms
10,628 KB
testcase_13 AC 575 ms
10,644 KB
testcase_14 AC 576 ms
10,844 KB
testcase_15 AC 578 ms
10,632 KB
testcase_16 AC 580 ms
10,860 KB
testcase_17 AC 577 ms
10,608 KB
testcase_18 AC 17 ms
10,700 KB
testcase_19 AC 15 ms
10,640 KB
testcase_20 AC 14 ms
10,760 KB
testcase_21 AC 15 ms
10,600 KB
testcase_22 AC 14 ms
10,580 KB
testcase_23 AC 14 ms
10,612 KB
testcase_24 AC 14 ms
10,528 KB
testcase_25 AC 15 ms
10,640 KB
testcase_26 AC 15 ms
10,524 KB
testcase_27 AC 16 ms
10,636 KB
testcase_28 AC 25 ms
10,768 KB
testcase_29 AC 38 ms
10,668 KB
testcase_30 AC 197 ms
10,708 KB
testcase_31 AC 297 ms
10,592 KB
testcase_32 AC 417 ms
10,840 KB
testcase_33 AC 164 ms
10,828 KB
testcase_34 AC 338 ms
10,832 KB
testcase_35 AC 308 ms
10,764 KB
testcase_36 AC 324 ms
10,780 KB
testcase_37 AC 296 ms
10,644 KB
testcase_38 AC 354 ms
10,712 KB
testcase_39 AC 252 ms
10,580 KB
testcase_40 AC 254 ms
10,832 KB
testcase_41 AC 249 ms
10,540 KB
testcase_42 AC 15 ms
10,544 KB
testcase_43 AC 14 ms
10,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include<atcoder/all>
using namespace std;
//using namespace atcoder;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<ll>>;


int main() {
    vector<ll> P(1e6+10, -1);
    rep(i, 1e6 + 10) {
        P[i] = i;
    }
    P[0] = P[1] = -1;
    rep(p, 1e6 + 10) {
        if (P[p]==p) {
            for (ll j = p + p; j <= 1e6 + 4; j += p) {
                if(P[j]==j)P[j] = p;
            }
        }

    }
    ll N;
    cin >> N;
    ll AN = 0;
    rep(i, N) {
        ll A;
        cin >> A;

        ll k = 0;
        while (A != 1) {
            A /= P[A];
            k++;
        }
        AN = AN ^ k;
        
    }
    cout << (AN== 0 ? "black" : "white") << endl;
}
0