結果

問題 No.1665 quotient replace
ユーザー んんん
提出日時 2022-12-25 18:08:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,601 ms / 3,000 ms
コード長 456 bytes
コンパイル時間 1,671 ms
コンパイル使用メモリ 193,040 KB
最終ジャッジ日時 2025-02-09 20:56:08
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int N;
    cin >> N;
    int n = 0;
    for (int _ = 0; _ < N; _++) {
        int a;
        cin >> a;
        int cnt = 0;
        for (int i = 2; i*i <= a; i++) {
            while (a % i == 0) {
                a /= i;
                cnt++;
            }
        }
        if (a != 1) cnt++;
        n ^= cnt;
    }

    if (n) cout << "white" << endl;
    else cout << "black" << endl;
}
0