結果

問題 No.32 貯金箱の憂鬱
ユーザー f Oxf Ox
提出日時 2021-04-13 17:40:56
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 504 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 42,352 KB
最終ジャッジ日時 2023-09-12 10:05:11
合計ジャッジ時間 3,269 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
42,172 KB
testcase_01 AC 76 ms
42,280 KB
testcase_02 AC 76 ms
42,352 KB
testcase_03 AC 76 ms
42,240 KB
testcase_04 AC 76 ms
42,352 KB
testcase_05 AC 75 ms
42,208 KB
testcase_06 AC 76 ms
42,208 KB
testcase_07 AC 77 ms
42,336 KB
testcase_08 AC 76 ms
42,204 KB
testcase_09 AC 76 ms
42,188 KB
testcase_10 AC 77 ms
42,208 KB
testcase_11 AC 76 ms
42,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
  const data = input.split("\n");
  let L = Number(data[0]);
  let M = Number(data[1]);
  let N = Number(data[2]);

  M = M + Math.floor(N/25);
  if (N/25>=1) {
    N = N%25; // ここでNの枚数が確定する。
  }

  L = L + Math.floor(M/4);
  if (M/4>=1) {
    M = M%4; // ここでMの枚数が確定する。
  }
  
  if (L/10>=1) {
    L = L%10; // ここでLの枚数が確定する。
  }

  console.log(N+M+L);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0