結果

問題 No.1934 Four Fruits
ユーザー testtest
提出日時 2022-11-23 06:52:29
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 37,580 KB
最終ジャッジ日時 2023-10-24 18:57:42
合計ジャッジ時間 2,372 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
37,580 KB
testcase_01 AC 62 ms
37,580 KB
testcase_02 AC 61 ms
37,580 KB
testcase_03 AC 60 ms
37,580 KB
testcase_04 AC 64 ms
37,580 KB
testcase_05 AC 64 ms
37,580 KB
testcase_06 AC 61 ms
37,580 KB
testcase_07 AC 65 ms
37,580 KB
testcase_08 AC 64 ms
37,580 KB
testcase_09 AC 61 ms
37,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    const src = input.replace("\n", "").split(" ");
    const a = parseInt(src[0]);
    const b = parseInt(src[1]);
    const c = parseInt(src[2]);

    const arr = [0, 1, 2, 3];
    let ans = -1;

    if (a == b && a == c && b == c) ans = a;
    if (a != b && a != c && b == c) ans = a;
    if (a != b && a == c && b != c) ans = b;
    if (a == b && a != c && b != c) ans = c;
    if (a != b && a != c && b != c)
        ans = arr.filter(n => n != a && n != b && n != c)[0];

    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0