結果

問題 No.1665 quotient replace
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2021-09-04 04:07:02
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 341 ms / 3,000 ms
コード長 764 bytes
コンパイル時間 1,129 ms
コンパイル使用メモリ 146,084 KB
実行使用メモリ 11,756 KB
最終ジャッジ日時 2023-08-22 08:43:30
合計ジャッジ時間 9,999 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
11,560 KB
testcase_01 AC 13 ms
11,412 KB
testcase_02 AC 13 ms
11,520 KB
testcase_03 AC 14 ms
11,436 KB
testcase_04 AC 14 ms
11,480 KB
testcase_05 AC 13 ms
11,444 KB
testcase_06 AC 16 ms
11,568 KB
testcase_07 AC 14 ms
11,444 KB
testcase_08 AC 15 ms
11,524 KB
testcase_09 AC 22 ms
11,564 KB
testcase_10 AC 121 ms
11,576 KB
testcase_11 AC 255 ms
11,756 KB
testcase_12 AC 38 ms
11,444 KB
testcase_13 AC 328 ms
11,452 KB
testcase_14 AC 326 ms
11,620 KB
testcase_15 AC 334 ms
11,512 KB
testcase_16 AC 339 ms
11,440 KB
testcase_17 AC 341 ms
11,520 KB
testcase_18 AC 13 ms
11,544 KB
testcase_19 AC 13 ms
11,448 KB
testcase_20 AC 13 ms
11,480 KB
testcase_21 AC 14 ms
11,572 KB
testcase_22 AC 13 ms
11,420 KB
testcase_23 AC 14 ms
11,440 KB
testcase_24 AC 14 ms
11,436 KB
testcase_25 AC 13 ms
11,452 KB
testcase_26 AC 14 ms
11,580 KB
testcase_27 AC 15 ms
11,412 KB
testcase_28 AC 24 ms
11,408 KB
testcase_29 AC 34 ms
11,480 KB
testcase_30 AC 173 ms
11,508 KB
testcase_31 AC 254 ms
11,636 KB
testcase_32 AC 249 ms
11,616 KB
testcase_33 AC 95 ms
11,424 KB
testcase_34 AC 199 ms
11,580 KB
testcase_35 AC 186 ms
11,480 KB
testcase_36 AC 194 ms
11,508 KB
testcase_37 AC 174 ms
11,412 KB
testcase_38 AC 205 ms
11,428 KB
testcase_39 AC 155 ms
11,408 KB
testcase_40 AC 155 ms
11,460 KB
testcase_41 AC 144 ms
11,420 KB
testcase_42 AC 14 ms
11,480 KB
testcase_43 AC 13 ms
11,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2021.09.04 04:06:58
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    int n;cin >> n;
    vector<int> a(1000001);
    vector<int> spf(1000001);
    vector<int> prime;
    for (int d = 2; d <= 1000000; d++) {
        if (a[d] == 0) {
            a[d] = 1;
            spf[d] = d;
            prime.push_back(d);
        }
        for(int p : prime) {
            if (p * d > 1000000 || p > spf[d]) break;
            a[p*d] = a[d] + 1;
            spf[p*d] = p;
        }
    }
    int grundy = 0;
    for (int i = 0; i < n; i++) {
        int t;cin >> t;
        grundy ^= a[t];
    }
    if (grundy == 0) puts("black");
    else puts("white");
    return 0;
}
0