結果

問題 No.1665 quotient replace
ユーザー publflpublfl
提出日時 2021-09-03 21:34:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,704 ms / 3,000 ms
コード長 607 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 49,024 KB
実行使用メモリ 123,344 KB
最終ジャッジ日時 2024-05-09 02:15:16
合計ジャッジ時間 72,135 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,426 ms
123,092 KB
testcase_01 AC 1,381 ms
123,092 KB
testcase_02 AC 1,377 ms
123,088 KB
testcase_03 AC 1,507 ms
123,212 KB
testcase_04 AC 1,417 ms
123,088 KB
testcase_05 AC 1,638 ms
123,216 KB
testcase_06 AC 1,488 ms
123,216 KB
testcase_07 AC 1,664 ms
123,216 KB
testcase_08 AC 1,498 ms
123,088 KB
testcase_09 AC 1,601 ms
123,340 KB
testcase_10 AC 1,537 ms
123,216 KB
testcase_11 AC 1,634 ms
123,344 KB
testcase_12 AC 1,405 ms
123,216 KB
testcase_13 AC 1,663 ms
123,216 KB
testcase_14 AC 1,674 ms
123,216 KB
testcase_15 AC 1,704 ms
123,216 KB
testcase_16 AC 1,657 ms
123,344 KB
testcase_17 AC 1,617 ms
123,220 KB
testcase_18 AC 1,450 ms
123,120 KB
testcase_19 AC 1,485 ms
123,216 KB
testcase_20 AC 1,491 ms
123,216 KB
testcase_21 AC 1,466 ms
123,216 KB
testcase_22 AC 1,449 ms
123,116 KB
testcase_23 AC 1,526 ms
123,104 KB
testcase_24 AC 1,507 ms
123,216 KB
testcase_25 AC 1,563 ms
123,212 KB
testcase_26 AC 1,571 ms
123,220 KB
testcase_27 AC 1,528 ms
123,212 KB
testcase_28 AC 1,539 ms
123,216 KB
testcase_29 AC 1,472 ms
123,216 KB
testcase_30 AC 1,523 ms
123,216 KB
testcase_31 AC 1,526 ms
123,344 KB
testcase_32 AC 1,529 ms
123,220 KB
testcase_33 AC 1,580 ms
123,344 KB
testcase_34 AC 1,651 ms
123,084 KB
testcase_35 AC 1,593 ms
123,220 KB
testcase_36 AC 1,607 ms
123,088 KB
testcase_37 AC 1,591 ms
123,084 KB
testcase_38 AC 1,574 ms
123,220 KB
testcase_39 AC 1,542 ms
123,088 KB
testcase_40 AC 1,539 ms
123,212 KB
testcase_41 AC 1,497 ms
123,344 KB
testcase_42 AC 1,552 ms
123,088 KB
testcase_43 AC 1,578 ms
123,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <vector>

std::vector<int> V[1000010];
int check[1000010],DP[1000010];
int main()
{
	for(int i=1;i<=1000000;i++) for(int j=2*i;j<=1000000;j+=i) V[j].push_back(i);
	
	DP[1] = 0;
	for(int i=2;i<=1000000;i++)
	{
		for(int j=0;j<V[i].size();j++) check[DP[V[i][j]]] = 1;
		for(int j=0;j<=i;j++)
		{
			if(check[j]==0)
			{
				DP[i] = j;
				break;
			}
		}
		for(int j=0;j<V[i].size();j++) check[DP[V[i][j]]] = 0;
	}
	
	int a;
	scanf("%d",&a);
	int ans = 0;
	for(int i=1;i<=a;i++)
	{
		int b;
		scanf("%d",&b);
		ans ^= DP[b];
	}
	if(ans==0) printf("black");
	else printf("white");
}
0