結果

問題 No.1665 quotient replace
ユーザー otoshigootoshigo
提出日時 2021-09-14 15:57:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 432 ms / 3,000 ms
コード長 1,048 bytes
コンパイル時間 2,013 ms
コンパイル使用メモリ 199,796 KB
実行使用メモリ 7,208 KB
最終ジャッジ日時 2023-09-09 13:19:39
合計ジャッジ時間 12,779 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
6,908 KB
testcase_01 AC 30 ms
7,128 KB
testcase_02 AC 31 ms
6,972 KB
testcase_03 AC 30 ms
6,952 KB
testcase_04 AC 30 ms
6,940 KB
testcase_05 AC 31 ms
7,036 KB
testcase_06 AC 32 ms
7,040 KB
testcase_07 AC 30 ms
7,032 KB
testcase_08 AC 31 ms
6,856 KB
testcase_09 AC 41 ms
7,024 KB
testcase_10 AC 164 ms
7,056 KB
testcase_11 AC 332 ms
7,204 KB
testcase_12 AC 62 ms
7,044 KB
testcase_13 AC 422 ms
6,884 KB
testcase_14 AC 427 ms
6,876 KB
testcase_15 AC 432 ms
7,000 KB
testcase_16 AC 419 ms
7,044 KB
testcase_17 AC 416 ms
7,000 KB
testcase_18 AC 31 ms
7,004 KB
testcase_19 AC 31 ms
7,208 KB
testcase_20 AC 31 ms
6,996 KB
testcase_21 AC 32 ms
6,932 KB
testcase_22 AC 31 ms
6,928 KB
testcase_23 AC 31 ms
7,040 KB
testcase_24 AC 31 ms
7,036 KB
testcase_25 AC 31 ms
6,904 KB
testcase_26 AC 31 ms
6,904 KB
testcase_27 AC 34 ms
6,984 KB
testcase_28 AC 40 ms
6,852 KB
testcase_29 AC 50 ms
7,208 KB
testcase_30 AC 179 ms
6,904 KB
testcase_31 AC 259 ms
7,048 KB
testcase_32 AC 328 ms
7,040 KB
testcase_33 AC 137 ms
6,928 KB
testcase_34 AC 267 ms
7,028 KB
testcase_35 AC 241 ms
7,056 KB
testcase_36 AC 247 ms
6,900 KB
testcase_37 AC 228 ms
6,852 KB
testcase_38 AC 265 ms
6,864 KB
testcase_39 AC 199 ms
7,072 KB
testcase_40 AC 199 ms
7,040 KB
testcase_41 AC 193 ms
6,904 KB
testcase_42 AC 30 ms
7,012 KB
testcase_43 AC 30 ms
7,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;  using vvi = vector<vi>;
using vl = vector<ll>;   using vvl = vector<vl>;
using vb = vector<bool>; using vvb = vector<vb>;
using vpi = vector<pii>; using vvpi = vector<vpi>;
using vpl = vector<pll>; using vvpl = vector<vpl>;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
#define rep(i,m,n) for (int i = m; i < (int)(n); i++)
#define rrep(i,m,n) for (int i = m; i > (int)(n); i--)

int main(){
    int M = 1000001;
    int n; cin >> n;
    vi P(M,0);
    P[1] = 1;
    for (int i = 2;i < M;i++){
        for (int j = i;j < M; j += i){
            if (P[j] == 0) P[j] = i;
        }
    }
    int judge = 0;
    rep(i,0,n){
        int a,x = 0; cin >> a;
        while (a > 1){
            a /= P[a];
            ++x;
        }
        judge ^= x;
    }
    if (judge != 0) cout << "white" << endl;
    else cout << "black" << endl;
}
0