結果

問題 No.1665 quotient replace
ユーザー asumo0729asumo0729
提出日時 2021-09-03 22:04:50
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 621 bytes
コンパイル時間 1,084 ms
コンパイル使用メモリ 119,808 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-09 04:07:17
合計ジャッジ時間 6,709 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 9 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 6 ms
5,376 KB
testcase_09 AC 30 ms
5,376 KB
testcase_10 RE -
testcase_11 AC 34 ms
5,376 KB
testcase_12 AC 81 ms
5,376 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 2 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 77 ms
5,376 KB
testcase_29 WA -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 WA -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int A[100009];
int x = 0;
int N;

int factorize(int x){
    int cnt = 0;
    for (int i = 2; i * i <= x; i++){
        if (x % i == 0){
            while (x % i == 0) {
                x = x / i;
                cnt++;
            }
        }
    }
    return cnt;
}

int main(){
    cin >> N;
    for (int i = 0; i < N; i++){
        cin >> A[i];
    }
    for (int i = 0; i < N; i++){
        int cnt;
        cnt = factorize(A[i]);
        x ^= cnt;
    }
    if (x == 0){
        cout << "black" << endl;
    }
    else{
        cout << "white" << endl;
    }
    return 0;
}
0