結果

問題 No.32 貯金箱の憂鬱
ユーザー newoota0331newoota0331
提出日時 2016-09-02 09:27:32
言語 Java19
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 677 bytes
コンパイル時間 3,304 ms
コンパイル使用メモリ 71,096 KB
実行使用メモリ 55,992 KB
最終ジャッジ日時 2023-09-30 08:13:45
合計ジャッジ時間 5,511 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,836 KB
testcase_01 AC 127 ms
55,992 KB
testcase_02 AC 127 ms
54,020 KB
testcase_03 AC 125 ms
55,920 KB
testcase_04 AC 125 ms
55,820 KB
testcase_05 AC 125 ms
55,820 KB
testcase_06 AC 125 ms
55,876 KB
testcase_07 AC 126 ms
55,684 KB
testcase_08 AC 125 ms
55,840 KB
testcase_09 AC 123 ms
55,780 KB
testcase_10 AC 125 ms
55,236 KB
testcase_11 AC 125 ms
55,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
		int yen1,yen25,yen100,coin;
		yen100 = sc.nextInt();
		yen25 = sc.nextInt();
		yen1 = sc.nextInt();
		coin = yen100+yen25+yen1;
		
		while(coin!=0){
			while(yen1>=25){
				yen1-=25;
				yen25+=1;
			}
			while(yen25>=4){
				yen25-=4;
				yen100+=1;
			}
			while(yen100>=10){
				yen100-=10;
			}
			break;
		}
		
		System.out.println(yen1+yen25+yen100);
		
	}
}
0