結果

問題 No.715 集合と二人ゲーム
ユーザー PulmnPulmn
提出日時 2018-07-13 23:10:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 1,554 bytes
コンパイル時間 1,933 ms
コンパイル使用メモリ 156,548 KB
実行使用メモリ 5,344 KB
最終ジャッジ日時 2023-07-30 10:02:43
合計ジャッジ時間 13,359 ms
ジャッジサーバーID
(参考情報)
judge5 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
4,376 KB
testcase_01 AC 116 ms
4,380 KB
testcase_02 AC 117 ms
4,376 KB
testcase_03 AC 118 ms
4,376 KB
testcase_04 AC 119 ms
4,376 KB
testcase_05 AC 120 ms
4,380 KB
testcase_06 AC 121 ms
4,376 KB
testcase_07 AC 122 ms
4,380 KB
testcase_08 AC 123 ms
4,380 KB
testcase_09 AC 124 ms
4,380 KB
testcase_10 AC 124 ms
4,376 KB
testcase_11 AC 125 ms
4,384 KB
testcase_12 AC 126 ms
4,380 KB
testcase_13 AC 128 ms
4,380 KB
testcase_14 AC 129 ms
4,380 KB
testcase_15 AC 129 ms
4,380 KB
testcase_16 AC 131 ms
4,380 KB
testcase_17 AC 130 ms
4,376 KB
testcase_18 AC 133 ms
4,376 KB
testcase_19 AC 133 ms
4,380 KB
testcase_20 AC 135 ms
4,384 KB
testcase_21 AC 136 ms
4,376 KB
testcase_22 AC 137 ms
4,380 KB
testcase_23 AC 136 ms
4,380 KB
testcase_24 AC 138 ms
4,376 KB
testcase_25 AC 139 ms
4,380 KB
testcase_26 AC 138 ms
4,380 KB
testcase_27 AC 141 ms
4,376 KB
testcase_28 AC 142 ms
4,380 KB
testcase_29 AC 143 ms
4,380 KB
testcase_30 AC 141 ms
4,376 KB
testcase_31 AC 137 ms
4,384 KB
testcase_32 AC 134 ms
4,376 KB
testcase_33 AC 138 ms
4,376 KB
testcase_34 AC 136 ms
4,376 KB
testcase_35 AC 116 ms
4,376 KB
testcase_36 AC 115 ms
4,380 KB
testcase_37 AC 115 ms
4,380 KB
testcase_38 AC 115 ms
4,376 KB
testcase_39 AC 115 ms
4,380 KB
testcase_40 AC 115 ms
4,376 KB
testcase_41 AC 116 ms
4,376 KB
testcase_42 AC 116 ms
4,376 KB
testcase_43 AC 116 ms
4,376 KB
testcase_44 AC 116 ms
4,384 KB
testcase_45 AC 116 ms
4,376 KB
testcase_46 AC 116 ms
4,376 KB
testcase_47 AC 116 ms
4,376 KB
testcase_48 AC 117 ms
4,376 KB
testcase_49 AC 115 ms
4,380 KB
testcase_50 AC 280 ms
4,856 KB
testcase_51 AC 281 ms
5,344 KB
testcase_52 AC 278 ms
4,792 KB
testcase_53 AC 273 ms
4,812 KB
testcase_54 AC 273 ms
4,860 KB
testcase_55 AC 278 ms
4,812 KB
testcase_56 AC 270 ms
5,080 KB
testcase_57 AC 260 ms
4,812 KB
testcase_58 AC 277 ms
4,792 KB
testcase_59 AC 280 ms
4,888 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;
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);
	cout<<(g?"First":"Second")<<endl;
}
0