結果

問題 No.542 1円玉と5円玉
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-10 23:54:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 74,872 KB
実行使用メモリ 41,580 KB
最終ジャッジ日時 2024-04-24 09:45:00
合計ジャッジ時間 4,323 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
41,056 KB
testcase_01 AC 116 ms
41,564 KB
testcase_02 AC 112 ms
41,372 KB
testcase_03 AC 115 ms
41,168 KB
testcase_04 AC 108 ms
40,192 KB
testcase_05 AC 134 ms
41,580 KB
testcase_06 AC 123 ms
40,144 KB
testcase_07 AC 146 ms
41,468 KB
testcase_08 AC 134 ms
41,344 KB
testcase_09 AC 140 ms
41,360 KB
testcase_10 AC 119 ms
41,448 KB
testcase_11 AC 117 ms
41,344 KB
testcase_12 AC 123 ms
40,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int one = sc.nextInt();
		int five = sc.nextInt();
		
		int max = 0;
		for (int i=0; i<=five; i++) {
			for (int j=0; j<=one; j++) {
				if (i==0&&j==0 || 5*i+j<=max) {continue;}
				System.out.println(5*i+j);
				if (j==one) {max = 5*i+j;}
			}
		}
	}
}
0