結果

問題 No.715 集合と二人ゲーム
ユーザー PulmnPulmn
提出日時 2018-07-13 23:09:01
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,608 bytes
コンパイル時間 1,543 ms
コンパイル使用メモリ 170,076 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-17 11:27:56
合計ジャッジ時間 6,632 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

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;
set<int> st;

int f(int x){
//	if(x<3000) return a[x];
	while(x<3000){
		if(st.find(x)==st.end()) x-=34;
	}
	return a[x];
}

int main(){
	st.insert(48);
	st.insert(50);
	st.insert(65);
	st.insert(68);
	st.insert(85);
	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