結果

問題 No.1665 quotient replace
ユーザー inksamuraiinksamurai
提出日時 2021-09-03 21:52:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 400 ms / 3,000 ms
コード長 969 bytes
コンパイル時間 1,931 ms
コンパイル使用メモリ 167,408 KB
実行使用メモリ 26,732 KB
最終ジャッジ日時 2024-05-09 03:27:48
合計ジャッジ時間 17,373 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 233 ms
26,624 KB
testcase_01 AC 230 ms
26,624 KB
testcase_02 AC 245 ms
26,496 KB
testcase_03 AC 242 ms
26,624 KB
testcase_04 AC 239 ms
26,624 KB
testcase_05 AC 229 ms
26,624 KB
testcase_06 AC 246 ms
26,624 KB
testcase_07 AC 245 ms
26,624 KB
testcase_08 AC 237 ms
26,624 KB
testcase_09 AC 242 ms
26,624 KB
testcase_10 AC 290 ms
26,616 KB
testcase_11 AC 348 ms
26,624 KB
testcase_12 AC 232 ms
26,496 KB
testcase_13 AC 391 ms
26,732 KB
testcase_14 AC 379 ms
26,624 KB
testcase_15 AC 383 ms
26,624 KB
testcase_16 AC 386 ms
26,624 KB
testcase_17 AC 400 ms
26,484 KB
testcase_18 AC 251 ms
26,540 KB
testcase_19 AC 236 ms
26,576 KB
testcase_20 AC 242 ms
26,624 KB
testcase_21 AC 238 ms
26,624 KB
testcase_22 AC 242 ms
26,624 KB
testcase_23 AC 229 ms
26,496 KB
testcase_24 AC 263 ms
26,496 KB
testcase_25 AC 289 ms
26,516 KB
testcase_26 AC 305 ms
26,624 KB
testcase_27 AC 283 ms
26,668 KB
testcase_28 AC 274 ms
26,512 KB
testcase_29 AC 284 ms
26,484 KB
testcase_30 AC 336 ms
26,624 KB
testcase_31 AC 376 ms
26,624 KB
testcase_32 AC 371 ms
26,484 KB
testcase_33 AC 293 ms
26,496 KB
testcase_34 AC 356 ms
26,624 KB
testcase_35 AC 341 ms
26,484 KB
testcase_36 AC 345 ms
26,624 KB
testcase_37 AC 342 ms
26,624 KB
testcase_38 AC 373 ms
26,620 KB
testcase_39 AC 328 ms
26,624 KB
testcase_40 AC 334 ms
26,580 KB
testcase_41 AC 318 ms
26,624 KB
testcase_42 AC 239 ms
26,624 KB
testcase_43 AC 257 ms
26,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//eolibraries
#define lnf 3999999999999999999
#define inf 999999999
#define fi first
#define se second
#define pb push_back
#define ll long long
#define ld long double
#define all(c) (c).begin(),(c).end()
#define sz(c) (ll)(c).size()
#define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end());
#define rep(i,n) for(ll i=0;i<n;i++)
#define drep(i,n) for(ll i=n-1;i>=0;i--)
#define crep(i,x,n) for(ll i=x;i<n;i++)
#define vec(...) vector<__VA_ARGS__>
#define _3sSOzgI ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
//eodefine
using namespace std;
using pii=pair<ll,ll>;
using vi=vec(ll);
const ll mxn=3000002;

int main(){
_3sSOzgI;
	vi cnt(mxn+10,0);
	for(int i=2;i<=mxn;i++){
		if(cnt[i]==0) cnt[i]=1;
		for(int j=i;j<=mxn;j+=i){
			if(cnt[j]<cnt[i]+1) cnt[j]=cnt[i]+1;
		}
	}
	ll n;
	cin>>n;
	ll xr=0;
	rep(i,n){
		ll x;
		cin>>x;
		xr^=cnt[x];
	}
	if(xr==0){
		cout<<"black\n";
	}else{
		cout<<"white\n";
	}
//	
	return 0;
}
0