結果

問題 No.677 10^Nの約数
ユーザー Mcpu3Mcpu3
提出日時 2018-09-25 16:00:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 640 bytes
コンパイル時間 1,925 ms
コンパイル使用メモリ 76,192 KB
実行使用メモリ 54,724 KB
最終ジャッジ日時 2024-04-15 06:05:35
合計ジャッジ時間 5,099 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
54,132 KB
testcase_01 AC 116 ms
53,108 KB
testcase_02 AC 117 ms
53,084 KB
testcase_03 AC 111 ms
52,992 KB
testcase_04 AC 110 ms
52,912 KB
testcase_05 AC 120 ms
54,152 KB
testcase_06 AC 119 ms
54,008 KB
testcase_07 AC 110 ms
52,956 KB
testcase_08 AC 116 ms
53,596 KB
testcase_09 AC 126 ms
54,232 KB
testcase_10 AC 123 ms
54,308 KB
testcase_11 AC 122 ms
53,492 KB
testcase_12 AC 129 ms
54,472 KB
testcase_13 AC 129 ms
53,968 KB
testcase_14 AC 137 ms
54,724 KB
testcase_15 AC 122 ms
53,120 KB
testcase_16 AC 122 ms
53,284 KB
testcase_17 AC 118 ms
53,092 KB
testcase_18 AC 135 ms
54,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = 0;
        long n = sc.nextLong(), a[] = new long[(int)Math.pow(n + 1, 2)], t = 0;
        sc.close();
        for(int i = 0; i <= n; ++i) {
            for(int j = 0; j <= n; ++j) {
                a[k] = (long)Math.pow(2, i) * (long)Math.pow(5, j);
                ++k;
            }
        }
        Arrays.sort(a);
        for(int i = 0; i < k; ++i) {
            if(a[i] != t) System.out.println(a[i]);
            t = a[i];
        }
    }
}
0