結果

問題 No.1665 quotient replace
ユーザー chocorusk
提出日時 2021-09-03 21:52:34
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,445 bytes
コンパイル時間 14,635 ms
コンパイル使用メモリ 233,516 KB
最終ジャッジ日時 2025-01-24 05:34:14
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

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