結果

問題 No.1665 quotient replace
コンテスト
ユーザー shakayami
提出日時 2021-09-03 21:41:29
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1,086 ms / 3,000 ms
+ 88µs
コード長 518 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,328 ms
コンパイル使用メモリ 209,520 KB
実行使用メモリ 9,796 KB
最終ジャッジ日時 2026-10-15 23:25:40
合計ジャッジ時間 15,856 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
int prime_count(int K){
    int res=0;
    int p=2;
    while(p*p<=K){
        while(K%p==0){
            res++;
            K/=p;
        }
        p++;
    }
    if (K>1){
        res++;
    }
    return res;
}
int main(void){
    int N;
    cin>>N;
    int Grundy=0;
    for(int i=0;i<N;i++){
        int A;
        cin>>A;
        Grundy^=prime_count(A);
    }
    if (Grundy==0){
        cout<<"black"<<endl;
    }
    else{
        cout<<"white"<<endl;
    }
    
}
0