結果

問題 No.2044 Infinite Nim
ユーザー みここ
提出日時 2022-12-14 00:11:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 670 ms
コンパイル使用メモリ 66,020 KB
最終ジャッジ日時 2025-02-09 11:14:07
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int x = 0, c = 0;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        if (a >= 0)
        {
            x ^= a;
        }
        else
        {
            c++;
        }
    }
    if (c % 2)
    {
        cout << "First" << endl;
    }
    else
    {
        cout << (x ? "First" : "Second") << endl;
    }
}
0