結果

問題 No.32 貯金箱の憂鬱
ユーザー ctktctkt
提出日時 2022-10-18 14:15:36
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 42,356 KB
最終ジャッジ日時 2023-09-11 07:59:20
合計ジャッジ時間 3,606 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 77 ms
42,272 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	let y100=Number(input[0]);
	let y25=Number(input[1]);
	let y1=Number(input[2]);
	while(y1>=25){
	    y25+=Math.floor(y1/25);
	    y1=y1%25;
	}
	
	while(y25>=4){
	    y100+=Math.floor(y25/4);
	    y25=y25%4;
	}
	
	console.log(y100+y25+y1);
}
//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0