結果

問題 No.715 集合と二人ゲーム
ユーザー kriiikriii
提出日時 2018-07-21 12:30:11
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 51,132 KB
実行使用メモリ 5,000 KB
最終ジャッジ日時 2023-08-27 00:33:05
合計ジャッジ時間 6,130 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 3 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 4 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 5 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 5 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 6 ms
4,376 KB
testcase_12 WA -
testcase_13 AC 7 ms
4,376 KB
testcase_14 WA -
testcase_15 AC 7 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 8 ms
4,376 KB
testcase_18 WA -
testcase_19 AC 9 ms
4,380 KB
testcase_20 WA -
testcase_21 AC 10 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 10 ms
4,376 KB
testcase_24 WA -
testcase_25 AC 11 ms
4,376 KB
testcase_26 WA -
testcase_27 AC 12 ms
4,376 KB
testcase_28 WA -
testcase_29 AC 13 ms
4,376 KB
testcase_30 WA -
testcase_31 AC 11 ms
4,376 KB
testcase_32 WA -
testcase_33 AC 11 ms
4,380 KB
testcase_34 WA -
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 2 ms
4,376 KB
testcase_43 AC 3 ms
4,376 KB
testcase_44 AC 3 ms
4,376 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 2 ms
4,380 KB
testcase_47 AC 2 ms
4,380 KB
testcase_48 AC 2 ms
4,380 KB
testcase_49 AC 2 ms
4,380 KB
testcase_50 WA -
testcase_51 AC 68 ms
4,984 KB
testcase_52 WA -
testcase_53 AC 67 ms
5,000 KB
testcase_54 WA -
testcase_55 AC 68 ms
4,944 KB
testcase_56 WA -
testcase_57 AC 61 ms
4,684 KB
testcase_58 WA -
testcase_59 AC 68 ms
4,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <set>
using namespace std;

int main()
{
	int A[170];
	A[0] = 0; A[1] = 1; A[2] = 1;
	for (int i=3;i<170;i++){
		set<int> k;
		k.insert(A[i-2]);
		k.insert(A[i-3]);
		for (int a=0;a<=i-3;a++){
			int x = A[a] ^ A[i-3-a];
			k.insert(x);
		}
		for (int j=0;;j++) if (!k.count(j)){
			A[i] = j; break;
		}
	}

	int N,V[500500];
	scanf ("%d",&N);
	for (int i=0;i<N;i++) scanf ("%d",&V[i]);
	sort(V,V+N);

	int l = 0, x = 0;
	for (int i=0;i<N;i++){
		if (i && V[i-1] + 1 == V[i]) x ^= A[l++];
		else l = 1;
		x ^= A[l];
	}
	
	puts(x?"First":"Second");

	return 0;
}
0