結果

問題 No.542 1円玉と5円玉
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-07-14 22:48:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 2,148 ms
コンパイル使用メモリ 73,912 KB
実行使用メモリ 41,608 KB
最終ジャッジ日時 2024-04-16 20:26:46
合計ジャッジ時間 4,600 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,044 KB
testcase_01 AC 128 ms
41,216 KB
testcase_02 AC 130 ms
41,264 KB
testcase_03 AC 129 ms
41,252 KB
testcase_04 AC 131 ms
41,304 KB
testcase_05 AC 145 ms
41,608 KB
testcase_06 AC 151 ms
41,432 KB
testcase_07 AC 152 ms
41,428 KB
testcase_08 AC 154 ms
41,400 KB
testcase_09 AC 141 ms
41,284 KB
testcase_10 AC 134 ms
41,420 KB
testcase_11 AC 138 ms
41,144 KB
testcase_12 AC 162 ms
41,380 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();
        boolean [] boo = new boolean [601];
        for(int i=0; i<=B; i++){
            for(int j=0; j<=A; j++){
                int tmp = i*5+j;
                boo[tmp] = true;
            }
        }
        for(int i=1; i<=600; i++){
            if(boo[i])System.out.println(i);
        }
    }
}
0