結果
| 問題 | No.2044 Infinite Nim |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2022-08-20 22:59:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 2,000 ms |
| コード長 | 490 bytes |
| 記録 | |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 40,832 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-09 14:32:03 |
| 合計ジャッジ時間 | 1,904 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2044.cc: No.2044 Infinite Nim - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
/* typedef */
/* global variables */
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
int x = 0, m = 0;
for (int i = 0; i < n; i++) {
int ai;
scanf("%d", &ai);
if (ai >= 0) x ^= ai;
else m ^= 1;
}
if (m || (m == 0 && x != 0)) puts("First");
else puts("Second");
return 0;
}
tnakao0123