結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
6,812 KB
testcase_01 AC 110 ms
6,944 KB
testcase_02 WA -
testcase_03 AC 112 ms
6,944 KB
testcase_04 WA -
testcase_05 AC 113 ms
6,944 KB
testcase_06 WA -
testcase_07 AC 115 ms
6,944 KB
testcase_08 WA -
testcase_09 AC 118 ms
6,944 KB
testcase_10 WA -
testcase_11 AC 119 ms
6,940 KB
testcase_12 AC 119 ms
6,940 KB
testcase_13 AC 121 ms
6,940 KB
testcase_14 WA -
testcase_15 AC 123 ms
6,948 KB
testcase_16 WA -
testcase_17 AC 123 ms
6,944 KB
testcase_18 WA -
testcase_19 AC 127 ms
6,944 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 131 ms
6,944 KB
testcase_24 AC 133 ms
6,940 KB
testcase_25 AC 134 ms
6,940 KB
testcase_26 WA -
testcase_27 AC 136 ms
6,940 KB
testcase_28 AC 137 ms
6,940 KB
testcase_29 AC 137 ms
6,940 KB
testcase_30 AC 133 ms
6,944 KB
testcase_31 AC 131 ms
6,940 KB
testcase_32 AC 129 ms
6,944 KB
testcase_33 AC 132 ms
6,940 KB
testcase_34 AC 131 ms
6,944 KB
testcase_35 AC 109 ms
6,944 KB
testcase_36 AC 108 ms
6,944 KB
testcase_37 AC 108 ms
6,944 KB
testcase_38 AC 109 ms
6,944 KB
testcase_39 AC 109 ms
6,944 KB
testcase_40 AC 109 ms
6,940 KB
testcase_41 AC 109 ms
6,944 KB
testcase_42 AC 109 ms
6,944 KB
testcase_43 AC 109 ms
6,940 KB
testcase_44 AC 110 ms
6,940 KB
testcase_45 AC 110 ms
6,944 KB
testcase_46 AC 109 ms
6,940 KB
testcase_47 AC 109 ms
6,944 KB
testcase_48 AC 109 ms
6,944 KB
testcase_49 AC 109 ms
6,940 KB
testcase_50 WA -
testcase_51 AC 283 ms
6,940 KB
testcase_52 WA -
testcase_53 AC 308 ms
6,940 KB
testcase_54 AC 280 ms
6,944 KB
testcase_55 AC 283 ms
6,940 KB
testcase_56 WA -
testcase_57 AC 261 ms
6,940 KB
testcase_58 WA -
testcase_59 AC 284 ms
6,940 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==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<3000;i++) if(a[i]!=a[i-34]) cout<<i<<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