結果

問題 No.32 貯金箱の憂鬱
ユーザー nesaianesaia
提出日時 2017-04-18 10:02:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 113 ms / 5,000 ms
コード長 674 bytes
コンパイル時間 3,806 ms
コンパイル使用メモリ 72,212 KB
実行使用メモリ 56,156 KB
最終ジャッジ日時 2023-09-30 10:21:48
合計ジャッジ時間 5,388 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
55,920 KB
testcase_01 AC 107 ms
53,760 KB
testcase_02 AC 107 ms
56,068 KB
testcase_03 AC 109 ms
55,956 KB
testcase_04 AC 107 ms
55,552 KB
testcase_05 AC 103 ms
55,788 KB
testcase_06 AC 108 ms
55,752 KB
testcase_07 AC 110 ms
56,156 KB
testcase_08 AC 105 ms
55,908 KB
testcase_09 AC 107 ms
56,072 KB
testcase_10 AC 113 ms
55,908 KB
testcase_11 AC 109 ms
56,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.32 貯金箱の憂鬱
//http://yukicoder.me/problems/5
//20170418 0930

package no32;

import java.util.Scanner;

public class Chr002 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] Kouka = new int[]{1, 25, 100};
		int Shihei = 1000;
		int in1, in25, in100;
		int sum;
		
		in100 = scan.nextInt();
		in25 = scan.nextInt();
		in1 = scan.nextInt();

		scan.close();
		
		sum = in1 * Kouka[0] + in25 * Kouka[1] + in100 * Kouka[2];
		
		sum = sum % Shihei;

		in100 = sum / Kouka[2];
		sum = sum % Kouka[2];
		
		in25 = sum / Kouka[1];
		sum = sum % Kouka[1];

		in1 = sum;

		System.out.println(in100 + in25+ in1);
		
		
	}

}
0