結果

問題 No.1665 quotient replace
ユーザー chocoruskchocorusk
提出日時 2021-09-03 21:52:34
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2,250 ms / 3,000 ms
コード長 1,445 bytes
コンパイル時間 3,357 ms
コンパイル使用メモリ 193,240 KB
実行使用メモリ 224,476 KB
最終ジャッジ日時 2023-08-21 21:27:07
合計ジャッジ時間 99,133 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,010 ms
224,260 KB
testcase_01 AC 1,999 ms
224,296 KB
testcase_02 AC 2,061 ms
224,264 KB
testcase_03 AC 2,017 ms
224,236 KB
testcase_04 AC 2,011 ms
224,324 KB
testcase_05 AC 2,019 ms
224,264 KB
testcase_06 AC 2,031 ms
224,236 KB
testcase_07 AC 1,999 ms
224,360 KB
testcase_08 AC 2,008 ms
224,476 KB
testcase_09 AC 2,020 ms
224,264 KB
testcase_10 AC 2,080 ms
224,320 KB
testcase_11 AC 2,125 ms
224,344 KB
testcase_12 AC 2,021 ms
224,476 KB
testcase_13 AC 2,183 ms
224,428 KB
testcase_14 AC 2,145 ms
224,264 KB
testcase_15 AC 2,163 ms
224,364 KB
testcase_16 AC 2,154 ms
224,300 KB
testcase_17 AC 2,161 ms
224,240 KB
testcase_18 AC 2,022 ms
224,288 KB
testcase_19 AC 2,019 ms
224,288 KB
testcase_20 AC 2,036 ms
224,392 KB
testcase_21 AC 2,017 ms
224,276 KB
testcase_22 AC 2,011 ms
224,276 KB
testcase_23 AC 2,014 ms
224,232 KB
testcase_24 AC 2,052 ms
224,428 KB
testcase_25 AC 2,021 ms
224,212 KB
testcase_26 AC 2,156 ms
224,232 KB
testcase_27 AC 2,083 ms
224,208 KB
testcase_28 AC 2,032 ms
224,296 KB
testcase_29 AC 2,030 ms
224,288 KB
testcase_30 AC 2,087 ms
224,196 KB
testcase_31 AC 2,250 ms
224,208 KB
testcase_32 AC 2,209 ms
224,292 KB
testcase_33 AC 2,073 ms
224,288 KB
testcase_34 AC 2,152 ms
224,264 KB
testcase_35 AC 2,126 ms
224,260 KB
testcase_36 AC 2,107 ms
224,476 KB
testcase_37 AC 2,089 ms
224,304 KB
testcase_38 AC 2,136 ms
224,212 KB
testcase_39 AC 2,071 ms
224,324 KB
testcase_40 AC 2,101 ms
224,296 KB
testcase_41 AC 2,093 ms
224,364 KB
testcase_42 AC 2,007 ms
224,356 KB
testcase_43 AC 2,033 ms
224,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
// using mint=modint998244353;
// mint f[2000010], invf[2000010];
// void fac(int n){
//     f[0]=1;
//     for(ll i=1; i<=n; i++) f[i]=f[i-1]*i;
//     invf[n]=f[n].inv();
//     for(ll i=n-1; i>=0; i--) invf[i]=invf[i+1]*(i+1);
// }
// mint comb(int x, int y){
//     if(!(0<=y && y<=x)) return 0;
//     return f[x]*invf[y]*invf[x-y];
// }
set<int> st[1000010];
int g[1000010];
int main()
{
    for(int d=1; d<=1000000; d++){
        for(int i=0; ; i++){
            if(st[d].find(i)==st[d].end()){
                g[d]=i;break;
            }
        }
        for(int i=2*d; i<=1000000; i+=d){
            st[i].insert(g[d]);
        }
    }
    int n; cin>>n;
    int s=0;
    for(int i=0; i<n; i++){
        int a;
        scanf("%d", &a);
        s^=g[a];
    }
    if(s) cout<<"white"<<endl;
    else cout<<"black"<<endl;
    return 0;
}
0