結果

問題 No.2044 Infinite Nim
コンテスト
ユーザー vjudge1
提出日時 2026-09-17 11:19:15
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 772 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,435 ms
コンパイル使用メモリ 330,200 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-17 11:19:20
合計ジャッジ時間 5,050 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define fi first
#define se second
#define ull unsigned long long
#define pb push_back
#define pr_queue priority_queue
#define ld long double
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const int maxn = 5e5 + 5;
//const ld INF = 1/.0;
//miyabi my beloved



int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1;
//	cin>>t;
	while(t--){
		int n;
		cin>>n;
		ll a[n + 1];
		int k = 0;
		ll sum = 0;
		for(int i = 1; i <= n; i++){
			cin>>a[i];
			if(a[i] == -1) k++;
			else sum ^= a[i];
		}
		if(k == 0){
			if(sum == 0) cout<<"Second\n";
			else cout<<"First\n";
		}
		else{
			if(k % 2) cout<<"First\n";
			else cout<<"Second\n";
		}
	}
}
0