結果

問題 No.2044 Infinite Nim
ユーザー ripity
提出日時 2022-11-01 19:31:21
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 1,917 ms
コンパイル使用メモリ 194,920 KB
最終ジャッジ日時 2025-02-08 16:46:09
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N, xor_acc = 0, cnt_inf = 0;
    cin >> N;
    vector<string> ans = {"Second", "First"};
    for( int i = 0; i < N; i++ ) {
        int A;
        cin >> A;
        if( A == -1 ) cnt_inf++;
        else xor_acc ^= A;
    }
    if( xor_acc == 0 && cnt_inf%2 == 0 ) cout << ans[0] << endl;
    else cout << ans[1] << endl;
}
0