結果
| 問題 | No.2044 Infinite Nim |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-09-17 18:18:48 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 6 ms / 2,000 ms |
| + 112µs | |
| コード長 | 1,547 bytes |
| 記録 | |
| コンパイル時間 | 2,391 ms |
| コンパイル使用メモリ | 347,376 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-17 18:18:55 |
| 合計ジャッジ時間 | 5,046 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define db double
#define fi first
#define se second
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<pair<int, int>>;
using mii = map<int, int>;
#define pb push_back
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define all(a) (a).begin(), (a).end()
inline void debug() {cerr << endl;}
template<class T, class... Args>
inline void debug(T x, Args... args) {cerr << x << ' '; debug(args...);}
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "] = ", debug(__VA_ARGS__)
const int INF = 4e18;
const int MOD = 1e9 + 7;
bool _ST;
int n; const int N = 1e5 + 5;
int X = 0, c = 0;
void GetInput() {
cin >> n;
while (n--) {
int a; cin >> a;
if (a==-1) c++;
else X ^= a;
}
}
void Solve() {
int ans = (X != 0);
if (c & 1) ans = 1;
cout << (ans ? "First" : "Second");
}
void PrintAns() {
}
bool _EN;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
#define FILE ""
if (fopen(FILE".INP", "r")) {
freopen(FILE".INP", "r", stdin);
freopen(FILE".OUT", "w", stdout);
}
int TEST = 1;
// cin >> TEST;
while (TEST--) {
GetInput();
Solve();
PrintAns();
}
#ifndef ONLINE_JUDGE
cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
cerr << "Memory used: " << fabs(&_ST - &_EN) / (double)(1024 * 1024) << " mb.\n";
#endif
return 0;
}
vjudge1