結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
41,596 KB
testcase_01 AC 128 ms
41,500 KB
testcase_02 AC 124 ms
41,472 KB
testcase_03 AC 124 ms
41,368 KB
testcase_04 AC 115 ms
39,852 KB
testcase_05 AC 143 ms
41,844 KB
testcase_06 AC 147 ms
40,536 KB
testcase_07 AC 144 ms
41,728 KB
testcase_08 AC 142 ms
41,656 KB
testcase_09 AC 140 ms
40,576 KB
testcase_10 AC 129 ms
41,516 KB
testcase_11 WA -
testcase_12 AC 170 ms
41,252 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 = 1; i < list.length; i++){
            System.out.println(list[i]);
        }
    }

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