結果

問題 No.1665 quotient replace
ユーザー 👑 CleyLCleyL
提出日時 2022-08-28 11:53:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2,184 ms / 3,000 ms
コード長 440 bytes
コンパイル時間 2,743 ms
コンパイル使用メモリ 65,500 KB
最終ジャッジ日時 2025-02-06 22:12:46
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int n;cin>>n;
    int nw = 0;
    for(int i = 0; n > i; i++){
        int a;cin>>a;
        int k = 0;
        for(int j = 2; a >= j*j; j++){
            while(a%j == 0){
                a/=j;
                k++;
            }
        }
        if(a!=1)k++;
        nw ^= k;
    }
    if(nw == 0){
        cout << "black" << endl;
    }else{
        cout << "white" << endl;
    }
}
0