結果

問題 No.1229 ラグビーの得点パターン
ユーザー testtest
提出日時 2022-11-20 06:47:31
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 41,560 KB
最終ジャッジ日時 2023-10-21 08:02:17
合計ジャッジ時間 4,412 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
37,484 KB
testcase_01 AC 71 ms
37,484 KB
testcase_02 AC 74 ms
37,484 KB
testcase_03 AC 175 ms
41,560 KB
testcase_04 AC 69 ms
37,532 KB
testcase_05 AC 68 ms
37,532 KB
testcase_06 AC 71 ms
37,532 KB
testcase_07 AC 69 ms
37,532 KB
testcase_08 AC 69 ms
37,532 KB
testcase_09 AC 70 ms
37,532 KB
testcase_10 AC 70 ms
37,532 KB
testcase_11 AC 69 ms
37,500 KB
testcase_12 AC 69 ms
37,500 KB
testcase_13 AC 69 ms
37,532 KB
testcase_14 AC 69 ms
37,500 KB
testcase_15 AC 68 ms
37,500 KB
testcase_16 AC 69 ms
37,516 KB
testcase_17 AC 69 ms
37,516 KB
testcase_18 AC 69 ms
37,524 KB
testcase_19 AC 69 ms
37,500 KB
testcase_20 AC 69 ms
37,500 KB
testcase_21 AC 68 ms
37,540 KB
testcase_22 AC 70 ms
37,560 KB
testcase_23 AC 68 ms
37,560 KB
testcase_24 AC 70 ms
37,500 KB
testcase_25 AC 70 ms
37,572 KB
testcase_26 AC 73 ms
41,016 KB
testcase_27 AC 75 ms
41,356 KB
testcase_28 AC 74 ms
41,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    let N = input.replace("\n", "");
    let ans = 0;
    for (let t = 0; t <= N / 5; t++) {
        for (let g = 0; g <= t; g++) {
            for (let p = 0; p <= N / 3; p++) {
                if (t * 5 + g * 2 + p * 3 == N) ans++;
            }
        }
    }
    console.log(ans.toString());
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0