結果

問題 No.1665 quotient replace
ユーザー asumo0729
提出日時 2021-09-03 22:15:14
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 692 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 119,552 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-15 13:59:10
合計ジャッジ時間 5,813 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 22 WA * 2 RE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

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

int factorize(int x){
    int cnt = 0;
    int temp = x;
    for (int i = 2; i * i <= x; i++){
        if (temp % i == 0){
            while (temp % i == 0) {
                temp = temp / i;
                cnt++;
            }
        }
    if (temp != 1){
        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