結果

問題 No.715 集合と二人ゲーム
ユーザー PulmnPulmn
提出日時 2018-07-13 23:06:15
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,526 bytes
コンパイル時間 2,058 ms
コンパイル使用メモリ 166,324 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 11:25:03
合計ジャッジ時間 14,556 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
5,248 KB
testcase_01 AC 110 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 111 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 108 ms
5,376 KB
testcase_06 AC 105 ms
5,376 KB
testcase_07 AC 108 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 121 ms
5,376 KB
testcase_10 AC 117 ms
5,376 KB
testcase_11 AC 115 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 113 ms
5,376 KB
testcase_14 WA -
testcase_15 AC 119 ms
5,376 KB
testcase_16 WA -
testcase_17 AC 125 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 122 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 121 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 125 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 132 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 126 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 130 ms
5,376 KB
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 WA -
testcase_36 AC 107 ms
5,376 KB
testcase_37 AC 108 ms
5,376 KB
testcase_38 AC 104 ms
5,376 KB
testcase_39 AC 105 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 103 ms
5,376 KB
testcase_42 WA -
testcase_43 AC 103 ms
5,376 KB
testcase_44 WA -
testcase_45 AC 104 ms
5,376 KB
testcase_46 WA -
testcase_47 AC 105 ms
5,376 KB
testcase_48 WA -
testcase_49 AC 104 ms
5,376 KB
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

vi a(3000);
int n;
vi b;

int f(int x){
//	if(x<3000) return a[x];
	if(x==48||x==50||x==65||x==68||x==85) return a[x];
	return a[max(0,x-34)];
}

int main(){
	a[1]=a[2]=1;
	for(int i=3;i<3000;i++){
		vi b;
		for(int j=0;j<i;j++){
			int A=max(0,j-1),B=max(0,i-j-2);
			if(B<0) continue;
			b.push_back(a[A]^a[B]);
		}
		sort(b.begin(),b.end());
		b.erase(unique(b.begin(),b.end()),b.end());
		int T=-1;
		for(int j=0;j<b.size();j++) if(b[j]!=j){
			T=j;
			break;
		}
		if(T==-1) T=b.size();
		a[i]=T;
	}
//	for(int i=34;i<3000;i++) if(a[i]!=a[i-34]) cout<<i<<' '<<a[i]<<' '<<a[34]<<endl;
	cin>>n;
	b=vi(n);
	for(int i=0;i<n;i++) cin>>b[i];
	sort(b.begin(),b.end());
	int g=0,t=0;
	for(int i=1;i<n;i++) if(b[i]-b[i-1]>1){
		g^=f(i-t);
		t=i;
	}
	g^=f(n-t);
//	for(int i=0;i<3000;i++) if(f(i)!=a[i]) cout<<i<<endl;
	cout<<(g?"First":"Second")<<endl;
}
0