結果

問題 No.1665 quotient replace
ユーザー norikamenorikame
提出日時 2021-09-03 22:08:58
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,767 ms / 3,000 ms
コード長 810 bytes
コンパイル時間 2,143 ms
コンパイル使用メモリ 200,808 KB
実行使用メモリ 7,072 KB
最終ジャッジ日時 2023-08-21 22:04:18
合計ジャッジ時間 18,265 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 9 ms
4,380 KB
testcase_07 AC 3 ms
4,376 KB
testcase_08 AC 5 ms
4,380 KB
testcase_09 AC 29 ms
4,376 KB
testcase_10 AC 305 ms
4,644 KB
testcase_11 AC 682 ms
6,020 KB
testcase_12 AC 75 ms
4,380 KB
testcase_13 AC 895 ms
6,920 KB
testcase_14 AC 893 ms
7,048 KB
testcase_15 AC 891 ms
6,892 KB
testcase_16 AC 897 ms
7,072 KB
testcase_17 AC 898 ms
6,840 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 7 ms
4,380 KB
testcase_27 AC 17 ms
4,376 KB
testcase_28 AC 76 ms
4,376 KB
testcase_29 AC 155 ms
4,380 KB
testcase_30 AC 1,132 ms
5,268 KB
testcase_31 AC 1,767 ms
6,488 KB
testcase_32 AC 664 ms
5,784 KB
testcase_33 AC 246 ms
4,380 KB
testcase_34 AC 523 ms
5,684 KB
testcase_35 AC 477 ms
5,120 KB
testcase_36 AC 496 ms
4,376 KB
testcase_37 AC 454 ms
4,908 KB
testcase_38 AC 547 ms
5,444 KB
testcase_39 AC 386 ms
4,900 KB
testcase_40 AC 383 ms
4,532 KB
testcase_41 AC 385 ms
4,648 KB
testcase_42 AC 2 ms
4,376 KB
testcase_43 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#define all(x) (x).begin(), (x).end()

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int cnt = 0;
    rep(i, n) if (a[i] > 1) {
        int val = 0;
        int ai = a[i];
        for (int j=2; j*j<=ai; ++j) {
            while (ai%j == 0) {
                ai /= j;
                ++val;
            }
        }
        if (ai > 1) ++val;
        cnt ^= val;
    }
    if (cnt != 0) cout << "white" << endl;
    else cout << "black" << endl;
    return 0;
}
0