結果

問題 No.542 1円玉と5円玉
ユーザー youthfuldays072youthfuldays072
提出日時 2018-06-16 22:29:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 2,157 ms
コンパイル使用メモリ 72,080 KB
実行使用メモリ 56,944 KB
最終ジャッジ日時 2023-09-13 06:16:38
合計ジャッジ時間 4,761 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,004 KB
testcase_01 AC 120 ms
55,860 KB
testcase_02 AC 123 ms
55,776 KB
testcase_03 AC 125 ms
55,964 KB
testcase_04 AC 120 ms
55,768 KB
testcase_05 AC 140 ms
56,360 KB
testcase_06 AC 142 ms
55,876 KB
testcase_07 AC 151 ms
56,944 KB
testcase_08 AC 144 ms
56,240 KB
testcase_09 AC 145 ms
56,380 KB
testcase_10 AC 131 ms
55,612 KB
testcase_11 AC 127 ms
55,600 KB
testcase_12 AC 154 ms
55,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main{
	int[] L;
	int N;
	long K;

	public static void main(String[] args) {
		Main main=new Main();
		main.run();
	}

	void run() {

		Scanner sc=new Scanner(System.in);

		int A=sc.nextInt();
		int B=sc.nextInt();

		Set<Integer> res=new TreeSet<Integer>();

		for(int i=0;i<=A;i++) {
			for(int j=0;j<=B;j++) {
				int val=i+j*5;


				res.add(val);
			}
		}

		res.remove(0);

		for(Integer I:res) {
			System.out.println(I);
		}

	}

}

0