結果

問題 No.715 集合と二人ゲーム
ユーザー PulmnPulmn
提出日時 2018-07-13 23:02:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,459 bytes
コンパイル時間 1,420 ms
コンパイル使用メモリ 165,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 11:23:22
合計ジャッジ時間 11,640 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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[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<300;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);
	cout<<(g?"First":"Second")<<endl;
}
0