結果

問題 No.32 貯金箱の憂鬱
ユーザー megane_ankomegane_anko
提出日時 2021-02-07 11:27:45
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 751 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 42,308 KB
最終ジャッジ日時 2023-09-17 02:07:10
合計ジャッジ時間 4,188 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
42,192 KB
testcase_01 AC 78 ms
42,112 KB
testcase_02 AC 77 ms
42,220 KB
testcase_03 AC 79 ms
42,260 KB
testcase_04 AC 78 ms
42,280 KB
testcase_05 AC 78 ms
42,112 KB
testcase_06 AC 78 ms
42,180 KB
testcase_07 AC 80 ms
42,228 KB
testcase_08 AC 77 ms
42,176 KB
testcase_09 AC 78 ms
42,204 KB
testcase_10 AC 78 ms
42,292 KB
testcase_11 AC 79 ms
42,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

const input = require('fs').readFileSync('/dev/stdin', 'utf8');

const arr = input.split('\n');
let L = parseInt(arr[0]);
let M = parseInt(arr[1]);
let N = parseInt(arr[2]);


//change
let cha1 = 0;//両替できる1円玉の枚数
let cha2 = 0;//両替できる25円玉
let cha3 = 0;//両替できる100円玉

//surplus
let sur1 = 0;//両替後の1円玉
let sur2 = 0;//両替後の25円玉
let sur3 = 0;//両替後の100円玉

cha1 = Math.floor(N / 25);
//console.log(cha1);
sur1 = N - (25 * cha1);
//console.log(sur1);
cha2 = Math.floor((M + cha1) / 4);
sur2 = (M + cha1) - (4 * cha2);
//console.log(sur2);//ここちがう
cha3 = Math.floor((L + cha2) / 10);
sur3 = (L + cha2) - (10 * cha3);
//console.log(sur3);
console.log(sur1 + sur2 + sur3);
0