結果

問題 No.2619 Sorted Nim
ユーザー TairitsuMeowTairitsuMeow
提出日時 2024-01-26 21:24:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 972 bytes
コンパイル時間 1,425 ms
コンパイル使用メモリ 168,296 KB
実行使用メモリ 10,468 KB
最終ジャッジ日時 2024-01-26 21:24:55
合計ジャッジ時間 7,517 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,676 KB
testcase_01 AC 3 ms
6,676 KB
testcase_02 AC 10 ms
10,468 KB
testcase_03 AC 11 ms
10,468 KB
testcase_04 AC 10 ms
10,468 KB
testcase_05 AC 9 ms
10,468 KB
testcase_06 AC 11 ms
10,468 KB
testcase_07 AC 9 ms
10,468 KB
testcase_08 AC 12 ms
10,468 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 11 ms
10,468 KB
testcase_11 AC 10 ms
10,468 KB
testcase_12 AC 11 ms
10,468 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 10 ms
10,468 KB
testcase_15 AC 10 ms
10,468 KB
testcase_16 AC 11 ms
10,468 KB
testcase_17 AC 11 ms
10,468 KB
testcase_18 AC 11 ms
10,468 KB
testcase_19 AC 11 ms
10,468 KB
testcase_20 AC 9 ms
10,468 KB
testcase_21 AC 11 ms
10,468 KB
testcase_22 AC 9 ms
10,468 KB
testcase_23 AC 10 ms
10,468 KB
testcase_24 AC 11 ms
10,468 KB
testcase_25 AC 12 ms
10,468 KB
testcase_26 AC 10 ms
10,468 KB
testcase_27 AC 9 ms
10,468 KB
testcase_28 AC 11 ms
10,468 KB
testcase_29 AC 11 ms
10,468 KB
testcase_30 AC 10 ms
10,468 KB
testcase_31 AC 2 ms
6,676 KB
testcase_32 AC 10 ms
10,468 KB
testcase_33 AC 10 ms
10,468 KB
testcase_34 AC 9 ms
10,468 KB
testcase_35 AC 10 ms
10,468 KB
testcase_36 AC 11 ms
10,468 KB
testcase_37 AC 2 ms
6,676 KB
testcase_38 AC 10 ms
10,468 KB
testcase_39 AC 10 ms
10,468 KB
testcase_40 AC 11 ms
10,468 KB
testcase_41 AC 10 ms
10,468 KB
testcase_42 AC 9 ms
10,468 KB
testcase_43 AC 10 ms
10,468 KB
testcase_44 AC 10 ms
10,468 KB
testcase_45 AC 10 ms
10,468 KB
testcase_46 AC 11 ms
10,468 KB
testcase_47 AC 9 ms
10,468 KB
testcase_48 AC 2 ms
6,676 KB
testcase_49 AC 10 ms
10,468 KB
testcase_50 AC 9 ms
10,468 KB
testcase_51 AC 10 ms
10,468 KB
testcase_52 AC 2 ms
6,676 KB
testcase_53 AC 11 ms
10,468 KB
testcase_54 AC 10 ms
10,468 KB
testcase_55 AC 11 ms
10,468 KB
testcase_56 AC 11 ms
10,468 KB
testcase_57 AC 11 ms
10,468 KB
testcase_58 AC 12 ms
10,468 KB
testcase_59 AC 10 ms
10,468 KB
testcase_60 AC 9 ms
10,468 KB
testcase_61 AC 9 ms
10,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// Problem: No.2619 Sorted Nim
// Contest: yukicoder
// URL: https://yukicoder.me/problems/no/2619
// Memory Limit: 512 MB
// Time Limit: 2000 ms

#include<bits/stdc++.h>
#define debug(x) cerr<<(#x)<<" "<<(x)<<endl
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<ll,ll>
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define per(i,a,b) for(ll i=(a);i>=(b);--i)
using namespace std;
bool Mbe; 
ll read(){
	ll x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
void write(ll x){
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);
	putchar(x%10+'0');
}
const ll N=1e6+9;
ll n,a[N],b[N];
bool Med;
int main(){
	cerr<<fabs(&Med-&Mbe)/1048576.0<<"MB\n";
	n=read();
	rep(i,1,n)a[i]=read();
	rep(i,1,n)b[i]=a[i]-a[i-1];
	reverse(b+1,b+n+1);
	ll o=0;
	rep(i,1,n){
		if(i&1)o^=b[i];
	}
	if(o)puts("First");
	else puts("Second");
	return 0;
}
0