結果

問題 No.542 1円玉と5円玉
ユーザー tentententen
提出日時 2020-10-09 12:58:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 1,884 ms
コンパイル使用メモリ 72,864 KB
実行使用メモリ 56,116 KB
最終ジャッジ日時 2023-09-27 12:36:29
合計ジャッジ時間 4,334 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,748 KB
testcase_01 AC 113 ms
55,896 KB
testcase_02 AC 114 ms
55,740 KB
testcase_03 AC 118 ms
56,080 KB
testcase_04 AC 119 ms
56,076 KB
testcase_05 AC 123 ms
55,492 KB
testcase_06 AC 125 ms
56,024 KB
testcase_07 AC 125 ms
55,788 KB
testcase_08 AC 124 ms
55,644 KB
testcase_09 AC 123 ms
55,796 KB
testcase_10 AC 119 ms
56,116 KB
testcase_11 AC 118 ms
56,012 KB
testcase_12 AC 131 ms
55,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        TreeSet<Integer> set = new TreeSet<>();
        for (int i = 0; i <= b; i++) {
            for (int j = 0; j <= a; j++) {
                set.add(i * 5 + j);
            }
        }
        set.remove(0);
        StringBuilder sb = new StringBuilder();
        for (int x : set) {
            sb.append(x).append("\n");
        }
        System.out.print(sb);
    }
}
0