結果

問題 No.542 1円玉と5円玉
ユーザー GrenacheGrenache
提出日時 2017-07-14 22:22:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 740 bytes
コンパイル時間 3,322 ms
コンパイル使用メモリ 76,968 KB
実行使用メモリ 41,840 KB
最終ジャッジ日時 2024-04-16 19:54:24
合計ジャッジ時間 5,977 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
41,328 KB
testcase_01 AC 126 ms
41,840 KB
testcase_02 AC 124 ms
41,252 KB
testcase_03 AC 129 ms
41,552 KB
testcase_04 AC 129 ms
41,680 KB
testcase_05 AC 139 ms
41,288 KB
testcase_06 AC 150 ms
41,432 KB
testcase_07 AC 134 ms
41,736 KB
testcase_08 AC 144 ms
41,692 KB
testcase_09 AC 150 ms
41,560 KB
testcase_10 AC 129 ms
41,292 KB
testcase_11 AC 133 ms
41,800 KB
testcase_12 AC 163 ms
41,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder542 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		Set<Integer> hs = new TreeSet<>();
		for (int i = 0; i <= b; i++) {
			for (int j = 0; j <= a; j++) {
				hs.add(i * 5 + j);
			}
		}

		hs.remove(Integer.valueOf(0));

		for (int e : hs) {
			pr.println(e);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0