結果

問題 No.1665 quotient replace
ユーザー 👑 kmjpkmjp
提出日時 2021-09-03 22:44:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 213 ms / 3,000 ms
コード長 1,151 bytes
コンパイル時間 2,492 ms
コンパイル使用メモリ 201,520 KB
実行使用メモリ 15,232 KB
最終ジャッジ日時 2024-05-09 05:47:12
合計ジャッジ時間 8,948 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
11,136 KB
testcase_01 AC 47 ms
11,136 KB
testcase_02 AC 48 ms
11,136 KB
testcase_03 AC 48 ms
11,136 KB
testcase_04 AC 48 ms
11,264 KB
testcase_05 AC 47 ms
11,264 KB
testcase_06 AC 49 ms
11,392 KB
testcase_07 AC 47 ms
11,264 KB
testcase_08 AC 49 ms
11,264 KB
testcase_09 AC 52 ms
11,264 KB
testcase_10 AC 102 ms
12,544 KB
testcase_11 AC 170 ms
14,336 KB
testcase_12 AC 62 ms
11,520 KB
testcase_13 AC 208 ms
15,104 KB
testcase_14 AC 210 ms
15,104 KB
testcase_15 AC 212 ms
15,104 KB
testcase_16 AC 213 ms
15,104 KB
testcase_17 AC 210 ms
15,232 KB
testcase_18 AC 48 ms
11,136 KB
testcase_19 AC 48 ms
11,136 KB
testcase_20 AC 48 ms
11,008 KB
testcase_21 AC 48 ms
11,264 KB
testcase_22 AC 47 ms
11,136 KB
testcase_23 AC 48 ms
11,136 KB
testcase_24 AC 48 ms
11,136 KB
testcase_25 AC 48 ms
11,136 KB
testcase_26 AC 49 ms
11,264 KB
testcase_27 AC 50 ms
11,264 KB
testcase_28 AC 53 ms
11,264 KB
testcase_29 AC 59 ms
11,392 KB
testcase_30 AC 122 ms
13,312 KB
testcase_31 AC 160 ms
14,208 KB
testcase_32 AC 164 ms
13,952 KB
testcase_33 AC 93 ms
12,416 KB
testcase_34 AC 144 ms
13,440 KB
testcase_35 AC 135 ms
13,312 KB
testcase_36 AC 140 ms
13,440 KB
testcase_37 AC 135 ms
13,184 KB
testcase_38 AC 147 ms
13,568 KB
testcase_39 AC 118 ms
12,800 KB
testcase_40 AC 117 ms
12,800 KB
testcase_41 AC 119 ms
12,672 KB
testcase_42 AC 49 ms
11,136 KB
testcase_43 AC 49 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------

int N;
int A[1010101];

int mask[1010101];
int G[1010101];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	for(i=1;i<=1000000;i++) {
		while(mask[i]&(1<<G[i])) G[i]++;
		for(j=i*2;j<=1000000;j+=i) mask[j] |= 1<<G[i];
	}
	
	cin>>N;
	int nim=0;
	FOR(i,N) {
		cin>>A[i];
		nim^=G[A[i]];
	}
	if(nim==0) cout<<"black"<<endl;
	else cout<<"white"<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0