結果

問題 No.1665 quotient replace
ユーザー laneguelanegue
提出日時 2021-09-05 01:33:39
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 793 ms / 3,000 ms
コード長 598 bytes
コンパイル時間 3,448 ms
コンパイル使用メモリ 227,032 KB
実行使用メモリ 38,540 KB
最終ジャッジ日時 2023-09-04 13:56:16
合計ジャッジ時間 15,731 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 8 ms
4,384 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 5 ms
4,380 KB
testcase_09 AC 26 ms
4,720 KB
testcase_10 AC 267 ms
14,552 KB
testcase_11 AC 602 ms
31,248 KB
testcase_12 AC 66 ms
6,504 KB
testcase_13 AC 791 ms
37,340 KB
testcase_14 AC 791 ms
37,728 KB
testcase_15 AC 792 ms
37,652 KB
testcase_16 AC 793 ms
38,540 KB
testcase_17 AC 789 ms
38,260 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,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 3 ms
4,380 KB
testcase_27 AC 7 ms
5,732 KB
testcase_28 AC 26 ms
4,736 KB
testcase_29 AC 49 ms
6,068 KB
testcase_30 AC 355 ms
28,356 KB
testcase_31 AC 544 ms
31,928 KB
testcase_32 AC 578 ms
30,116 KB
testcase_33 AC 216 ms
14,796 KB
testcase_34 AC 464 ms
31,592 KB
testcase_35 AC 423 ms
30,748 KB
testcase_36 AC 445 ms
31,460 KB
testcase_37 AC 405 ms
30,200 KB
testcase_38 AC 487 ms
32,092 KB
testcase_39 AC 340 ms
18,824 KB
testcase_40 AC 340 ms
18,172 KB
testcase_41 AC 340 ms
18,124 KB
testcase_42 AC 2 ms
4,380 KB
testcase_43 AC 2 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{
				j++;
			}
		}
		if(x!=1){
			c[i]++;
		}
	}
	//stderr.writeln(c);
	auto r=c.reduce!((a,b) => a^b);
	stderr.writeln(r);
	if(r!=0){
		writeln("white");
	}else{
		writeln("black");
	}
}
0