結果

問題 No.542 1円玉と5円玉
ユーザー shinwisteriashinwisteria
提出日時 2018-03-13 19:35:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 4,127 ms
コンパイル使用メモリ 72,480 KB
実行使用メモリ 56,092 KB
最終ジャッジ日時 2023-08-14 16:44:40
合計ジャッジ時間 6,974 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,888 KB
testcase_01 AC 125 ms
53,732 KB
testcase_02 AC 125 ms
55,780 KB
testcase_03 AC 123 ms
55,788 KB
testcase_04 AC 125 ms
55,784 KB
testcase_05 AC 144 ms
56,052 KB
testcase_06 AC 156 ms
55,716 KB
testcase_07 AC 150 ms
55,888 KB
testcase_08 AC 151 ms
56,092 KB
testcase_09 AC 145 ms
55,948 KB
testcase_10 AC 124 ms
55,416 KB
testcase_11 AC 125 ms
55,572 KB
testcase_12 AC 161 ms
55,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con542 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt() , b = s.nextInt() , max = a + b * 5;
		s.close();

		if(a < 4){
			for(int i = 0;i <= b;i++){
				for(int j = 0;j <= a;j++){
					if(i + j != 0){
						System.out.println(i*5 + j);
					}
				}
			}
		}else{
			for(int i = 1;i <= max;i++){
				System.out.println(i);
			}
		}
	}

}
0