結果

問題 No.715 集合と二人ゲーム
ユーザー PulmnPulmn
提出日時 2018-07-13 23:21:41
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 1,312 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 164,876 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 11:34:27
合計ジャッジ時間 5,817 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 4 ms
5,376 KB
testcase_03 AC 5 ms
5,376 KB
testcase_04 AC 6 ms
5,376 KB
testcase_05 AC 7 ms
5,376 KB
testcase_06 AC 8 ms
5,376 KB
testcase_07 AC 9 ms
5,376 KB
testcase_08 AC 10 ms
5,376 KB
testcase_09 AC 11 ms
5,376 KB
testcase_10 AC 11 ms
5,376 KB
testcase_11 AC 13 ms
5,376 KB
testcase_12 AC 13 ms
5,376 KB
testcase_13 AC 14 ms
5,376 KB
testcase_14 AC 16 ms
5,376 KB
testcase_15 AC 16 ms
5,376 KB
testcase_16 AC 18 ms
5,376 KB
testcase_17 AC 17 ms
5,376 KB
testcase_18 AC 20 ms
5,376 KB
testcase_19 AC 20 ms
5,376 KB
testcase_20 AC 22 ms
5,376 KB
testcase_21 AC 23 ms
5,376 KB
testcase_22 AC 25 ms
5,376 KB
testcase_23 AC 24 ms
5,376 KB
testcase_24 AC 27 ms
5,376 KB
testcase_25 AC 26 ms
5,376 KB
testcase_26 AC 26 ms
5,376 KB
testcase_27 AC 30 ms
5,376 KB
testcase_28 AC 31 ms
5,376 KB
testcase_29 AC 31 ms
5,376 KB
testcase_30 AC 27 ms
5,376 KB
testcase_31 AC 25 ms
5,376 KB
testcase_32 AC 23 ms
5,376 KB
testcase_33 AC 26 ms
5,376 KB
testcase_34 AC 23 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 1 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 2 ms
5,376 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 2 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
testcase_46 AC 2 ms
5,376 KB
testcase_47 AC 3 ms
5,376 KB
testcase_48 AC 3 ms
5,376 KB
testcase_49 AC 2 ms
5,376 KB
testcase_50 AC 176 ms
5,376 KB
testcase_51 AC 176 ms
5,376 KB
testcase_52 AC 171 ms
5,376 KB
testcase_53 AC 168 ms
5,376 KB
testcase_54 AC 171 ms
5,376 KB
testcase_55 AC 174 ms
5,376 KB
testcase_56 AC 165 ms
5,376 KB
testcase_57 AC 155 ms
5,376 KB
testcase_58 AC 173 ms
5,376 KB
testcase_59 AC 176 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(86);
int n;
vi d;

int f(int x){
	while(x>85) x-=34;
	return a[x];
}

int main(){
	a[1]=a[2]=1;
	for(int i=3;i<86;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;
	}
	cin>>n;
	d=vi(n);
	for(int i=0;i<n;i++) cin>>d[i];
	sort(d.begin(),d.end());
	int g=0,t=0;
	for(int i=1;i<n;i++) if(d[i]-d[i-1]>1){
		g^=f(i-t);
		t=i;
	}
	g^=f(n-t);
	cout<<(g?"First":"Second")<<endl;
}
0