結果

問題 No.542 1円玉と5円玉
ユーザー yuya178yuya178
提出日時 2017-07-14 22:28:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 1,876 ms
コンパイル使用メモリ 74,168 KB
実行使用メモリ 41,924 KB
最終ジャッジ日時 2024-04-16 20:22:16
合計ジャッジ時間 4,303 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
41,740 KB
testcase_01 AC 121 ms
41,620 KB
testcase_02 AC 126 ms
41,836 KB
testcase_03 AC 126 ms
41,740 KB
testcase_04 AC 125 ms
41,676 KB
testcase_05 AC 145 ms
41,768 KB
testcase_06 AC 143 ms
41,924 KB
testcase_07 AC 146 ms
41,796 KB
testcase_08 AC 155 ms
41,836 KB
testcase_09 AC 148 ms
41,396 KB
testcase_10 AC 133 ms
41,692 KB
testcase_11 AC 132 ms
41,652 KB
testcase_12 AC 147 ms
41,816 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 S[] = new boolean[100000];
        S[0] = true;

        int res = 0;
        for(int i=0; i<=B; i++){
            for(int j=0; j<=A; j++){
                res = 5*i+1*j;
                if(S[res]==false) System.out.println(res);
                S[res]=true;
            }
        }
	}
}


0