結果

問題 No.1665 quotient replace
ユーザー laneguelanegue
提出日時 2021-09-05 01:21:24
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 3,903 ms
コンパイル使用メモリ 225,416 KB
実行使用メモリ 37,260 KB
最終ジャッジ日時 2023-09-04 13:55:59
合計ジャッジ時間 14,372 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 AC 2 ms
4,356 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 6 ms
4,352 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 18 ms
4,776 KB
testcase_10 AC 179 ms
14,896 KB
testcase_11 AC 413 ms
30,560 KB
testcase_12 AC 44 ms
6,096 KB
testcase_13 AC 529 ms
37,260 KB
testcase_14 AC 532 ms
37,220 KB
testcase_15 AC 528 ms
37,260 KB
testcase_16 AC 530 ms
37,196 KB
testcase_17 AC 529 ms
37,244 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,384 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 1 ms
4,388 KB
testcase_23 AC 2 ms
4,384 KB
testcase_24 AC 1 ms
4,384 KB
testcase_25 AC 2 ms
4,388 KB
testcase_26 AC 4 ms
4,384 KB
testcase_27 AC 9 ms
4,384 KB
testcase_28 AC 38 ms
4,748 KB
testcase_29 AC 76 ms
5,848 KB
testcase_30 AC 553 ms
27,904 KB
testcase_31 WA -
testcase_32 AC 387 ms
29,696 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 298 ms
29,784 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 1 ms
4,384 KB
testcase_43 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;
void main(){
	auto n=readln.chomp.to!int;
	auto a=readln.chomp.split(" ").to!(int[]);
	auto p=[2];
	for(auto i=3; i<10^^3; i+=2){
		auto f=true;
		for(auto j=0; p[j]^^2<=i; j++){
			if(i%p[j]==0){
				f=false;
				break;
			}
		}
		if(f){
			p~=i;
		}
	}
	auto c=new int[n];
	for(auto i=0; i<n; i++){
		auto x=a[i];
		for(auto j=0; j<p.length;){
			if(x%p[j]==0){
				c[i]++;
				x/=p[j];
			}else if(x<p[j]^^2){
				if(x>1) c[i]++;
				break;
			}else{
				j++;
			}
		}
	}
	//stderr.writeln(c);
	auto r=c.reduce!((a,b) => a^b);
	stderr.writeln(r);
	if(r!=0){
		writeln("white");
	}else{
		writeln("black");
	}
}
0