結果

問題 No.715 集合と二人ゲーム
ユーザー kotatsugamekotatsugame
提出日時 2020-04-22 18:48:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 646 ms
コンパイル使用メモリ 76,744 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-20 03:58:35
合計ジャッジ時間 9,178 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 11 ms
5,376 KB
testcase_05 AC 16 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 30 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 51 ms
5,376 KB
testcase_12 AC 63 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 80 ms
5,376 KB
testcase_15 AC 96 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 126 ms
5,376 KB
testcase_19 AC 145 ms
5,376 KB
testcase_20 AC 135 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 186 ms
5,376 KB
testcase_23 AC 219 ms
5,376 KB
testcase_24 AC 243 ms
5,376 KB
testcase_25 WA -
testcase_26 AC 216 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 321 ms
5,376 KB
testcase_30 TLE -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   22 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<set>
#include<algorithm>
using namespace std;
int N;
int A[5<<17];
int memo[5<<17];
bool vis[5<<17];
int gru(int X)
{
	if(vis[X])return memo[X];
	set<int>S;
	for(int i=3;i<=X;i++)
	{
		S.insert(gru(i-3)^gru(X-i));
	}
	int id=0;
	while(S.find(id)!=S.end())id++;
	vis[X]=true;
	return memo[X]=id;
}
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>A[i];
	sort(A,A+N);
	vis[0]=true;
	vis[1]=true;memo[1]=1;
	vis[2]=true;memo[1]=1;
	int ans=0;
	int c=1,pre=A[0];
	for(int i=1;i<N;i++)
	{
		if(pre+1<A[i])
		{
			ans^=gru(c);
			c=1;
		}
		else c++;
		pre=A[i];
	}
	ans^=gru(c);
	cout<<(ans?"First":"Second")<<endl;
}
0