結果

問題 No.542 1円玉と5円玉
ユーザー youthfuldays072
提出日時 2018-06-16 22:29:27
言語 Java
(openjdk 23)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 1,991 ms
コンパイル使用メモリ 74,792 KB
実行使用メモリ 44,488 KB
最終ジャッジ日時 2024-06-30 16:27:11
合計ジャッジ時間 4,510 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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