結果
| 問題 |
No.2044 Infinite Nim
|
| コンテスト | |
| ユーザー |
bit_kyopro
|
| 提出日時 | 2022-08-19 22:26:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 659 bytes |
| コンパイル時間 | 751 ms |
| コンパイル使用メモリ | 79,196 KB |
| 最終ジャッジ日時 | 2025-01-31 01:19:57 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 17 |
ソースコード
#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int n; cin >> n;
vector<ll> a;
ll inf = 0;
for (int i=0; i<n; i++) {
ll val;
cin >> val;
if (val == -1) {
inf++;
if (inf == 1) continue;
a.push_back(1);
} else {
a.push_back(val);
}
}
// if (inf == 0) {
// cout << "Second" << endl;
// return 0;
// }
ll x = 0;
for (auto val : a) x ^= val;
if (x == 0LL) cout << "Second" << endl;
else cout << "First" << endl;
}
bit_kyopro