結果

問題 No.542 1円玉と5円玉
ユーザー mosmos_21mosmos_21
提出日時 2017-07-14 22:28:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 1,963 ms
コンパイル使用メモリ 76,068 KB
実行使用メモリ 55,800 KB
最終ジャッジ日時 2024-04-16 20:22:26
合計ジャッジ時間 4,392 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
39,880 KB
testcase_01 AC 125 ms
41,468 KB
testcase_02 AC 127 ms
41,472 KB
testcase_03 AC 124 ms
41,240 KB
testcase_04 AC 126 ms
41,176 KB
testcase_05 AC 145 ms
41,276 KB
testcase_06 AC 153 ms
41,556 KB
testcase_07 AC 145 ms
41,704 KB
testcase_08 AC 146 ms
41,860 KB
testcase_09 AC 145 ms
41,712 KB
testcase_10 AC 124 ms
41,484 KB
testcase_11 WA -
testcase_12 AC 163 ms
41,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;

public class Main {
    Scanner in = new Scanner(System.in);

    public void solve() {
        int a = in.nextInt(), b = in.nextInt();
        HashSet<Integer> set = new HashSet<>();

        for (int i = 0; i <= a; i++) {
            for (int j = 0; j <= b; j++) {
                set.add(i + j * 5);
            }
        }
        Integer[] list = new Integer[set.size()];
        set.toArray(list);
        for (int i = 0; i < list.length; i++) {
            if (list[i] != 0)
                System.out.println(list[i]);
        }
    }

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