結果

問題 No.542 1円玉と5円玉
ユーザー YamaKasaYamaKasa
提出日時 2018-06-04 22:08:07
言語 Java
(openjdk 23)
結果
AC  
実行時間 170 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 2,402 ms
コンパイル使用メモリ 76,160 KB
実行使用メモリ 54,336 KB
最終ジャッジ日時 2024-06-30 09:48:06
合計ジャッジ時間 5,152 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		scan.close();
		Set<Integer> hash_set = new TreeSet<Integer>();
		int t = 0;

		for(int i = 0; i <= A; i++) {
			for(int j = 0; j <= B; j++) {
				t = i + 5 * j;
				hash_set.add(t);
			}
		}
		hash_set.remove(0);
		for(int i : hash_set) {
			System.out.println(i);
		}
	}
}
0