結果

問題 No.1665 quotient replace
ユーザー HaaHaa
提出日時 2021-09-03 21:39:05
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 306 ms / 3,000 ms
コード長 938 bytes
コンパイル時間 1,679 ms
コンパイル使用メモリ 167,796 KB
実行使用メモリ 18,968 KB
最終ジャッジ日時 2023-08-21 20:28:31
合計ジャッジ時間 8,367 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
10,712 KB
testcase_01 AC 16 ms
10,704 KB
testcase_02 AC 17 ms
10,888 KB
testcase_03 AC 17 ms
10,820 KB
testcase_04 AC 16 ms
10,844 KB
testcase_05 AC 16 ms
10,896 KB
testcase_06 AC 19 ms
10,824 KB
testcase_07 AC 16 ms
10,876 KB
testcase_08 AC 18 ms
10,712 KB
testcase_09 AC 25 ms
11,016 KB
testcase_10 AC 115 ms
13,352 KB
testcase_11 AC 235 ms
16,592 KB
testcase_12 AC 41 ms
11,636 KB
testcase_13 AC 306 ms
18,968 KB
testcase_14 AC 305 ms
18,968 KB
testcase_15 AC 303 ms
18,444 KB
testcase_16 AC 306 ms
18,816 KB
testcase_17 AC 306 ms
18,496 KB
testcase_18 AC 16 ms
10,892 KB
testcase_19 AC 16 ms
10,712 KB
testcase_20 AC 16 ms
10,660 KB
testcase_21 AC 16 ms
10,660 KB
testcase_22 AC 16 ms
10,844 KB
testcase_23 AC 16 ms
10,708 KB
testcase_24 AC 16 ms
10,716 KB
testcase_25 AC 16 ms
10,828 KB
testcase_26 AC 17 ms
10,832 KB
testcase_27 AC 18 ms
11,100 KB
testcase_28 AC 26 ms
11,044 KB
testcase_29 AC 36 ms
11,304 KB
testcase_30 AC 164 ms
14,868 KB
testcase_31 AC 242 ms
17,232 KB
testcase_32 AC 226 ms
16,560 KB
testcase_33 AC 96 ms
12,956 KB
testcase_34 AC 186 ms
15,440 KB
testcase_35 AC 171 ms
15,192 KB
testcase_36 AC 180 ms
15,308 KB
testcase_37 AC 163 ms
14,916 KB
testcase_38 AC 193 ms
15,656 KB
testcase_39 AC 139 ms
14,260 KB
testcase_40 AC 140 ms
14,352 KB
testcase_41 AC 142 ms
14,148 KB
testcase_42 AC 17 ms
10,760 KB
testcase_43 AC 16 ms
10,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
template<typename T> bool chmax(T &x, const T &y) {return (x<y)?(x=y,true):false;};
template<typename T> bool chmin(T &x, const T &y) {return (x>y)?(x=y,true):false;};
constexpr ll MOD=998244353;
constexpr ll INF=2e18;

const int M=1000000;

int main(){
    int n; cin >> n;
    VI a(n); REP(i,n) cin >> a[i];
    VI p(M+1,0);
    for(int i=2;i<=M;i++){
        if(p[i]==0){
            ll pw=1;
            while(pw*i<=M){
                pw=pw*i;
                for(ll j=pw;j<=M;j+=pw){
                    p[j]++;
                }
            }
        }
    }
    ll x=0;
    REP(i,n){
        x=(x^p[a[i]]);
    }
    if(x!=0)
        cout << "white" << endl;
    else
        cout << "black" << endl;
    return 0;
}
0