結果

問題 No.2044 Infinite Nim
ユーザー kokatsukokatsu
提出日時 2022-08-19 22:41:30
言語 D
(dmd 2.107.1)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 3,758 ms
コンパイル使用メモリ 203,512 KB
実行使用メモリ 8,604 KB
最終ジャッジ日時 2023-09-04 18:10:46
合計ジャッジ時間 3,433 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 12 ms
5,404 KB
testcase_14 AC 7 ms
4,408 KB
testcase_15 WA -
testcase_16 AC 7 ms
4,412 KB
testcase_17 AC 14 ms
5,692 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 11 ms
5,552 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 25 ms
8,520 KB
testcase_36 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    auto A = readln.chomp.split.to!(int[]);

    int X, cnt;
    foreach (a; A) {
        if (a == -1) ++cnt;
        else X ^= a;
    }

    bool isOK = (X > 0);
    if (cnt > 0 && cnt % 2 == 0) isOK = !isOK;

    writeln(isOK ? "First" : "Second");
}
0