結果

問題 No.542 1円玉と5円玉
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-14 08:55:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 3,324 ms
コンパイル使用メモリ 71,384 KB
実行使用メモリ 56,260 KB
最終ジャッジ日時 2023-08-22 21:31:13
合計ジャッジ時間 5,828 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,664 KB
testcase_01 AC 122 ms
55,860 KB
testcase_02 AC 122 ms
55,864 KB
testcase_03 AC 121 ms
55,692 KB
testcase_04 AC 123 ms
55,688 KB
testcase_05 AC 142 ms
56,260 KB
testcase_06 AC 143 ms
56,048 KB
testcase_07 AC 157 ms
56,028 KB
testcase_08 AC 154 ms
56,100 KB
testcase_09 AC 155 ms
56,016 KB
testcase_10 AC 126 ms
55,696 KB
testcase_11 AC 128 ms
55,876 KB
testcase_12 AC 166 ms
55,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No542 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(); //1円玉の枚数
		int B = sc.nextInt(); //5円玉の枚数
		
		for(int i = 0;i <= B;i++) {
			for(int j = 0;j <= A;j++) {
				if(i != B && j == 5) {
					break;
				}else {
					if(i + j != 0) {
						System.out.println(j  + i * 5);
					}
				}
			}
		}
	}
}
0