結果
| 問題 |
No.2044 Infinite Nim
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-19 21:48:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 434 bytes |
| コンパイル時間 | 1,428 ms |
| コンパイル使用メモリ | 166,008 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 06:04:23 |
| 合計ジャッジ時間 | 2,714 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
int cnt = 0, xo = 0;
for (int i = 0; i < n; i++) {
int u; cin >> u;
if (u == -1) {
cnt++;
} else {
xo ^= u;
}
}
if (cnt % 2) {
cout << "First";
} else {
cout << (xo == 0 ? "Second" : "First");
}
}