結果

問題 No.677 10^Nの約数
ユーザー face4face4
提出日時 2018-04-27 22:30:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 841 bytes
コンパイル時間 2,035 ms
コンパイル使用メモリ 72,452 KB
実行使用メモリ 49,792 KB
最終ジャッジ日時 2023-09-10 06:25:35
合計ジャッジ時間 3,901 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,540 KB
testcase_01 AC 44 ms
49,180 KB
testcase_02 AC 44 ms
49,300 KB
testcase_03 AC 44 ms
49,424 KB
testcase_04 AC 44 ms
49,424 KB
testcase_05 AC 45 ms
49,200 KB
testcase_06 AC 45 ms
49,340 KB
testcase_07 AC 45 ms
47,476 KB
testcase_08 AC 48 ms
49,256 KB
testcase_09 AC 49 ms
49,336 KB
testcase_10 AC 49 ms
49,608 KB
testcase_11 AC 50 ms
49,196 KB
testcase_12 AC 51 ms
49,792 KB
testcase_13 AC 52 ms
49,552 KB
testcase_14 AC 54 ms
49,360 KB
testcase_15 AC 55 ms
49,668 KB
testcase_16 AC 56 ms
49,420 KB
testcase_17 AC 58 ms
49,628 KB
testcase_18 AC 59 ms
47,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

class Main{
    static long pow(long x, int n){
        if(n == 0){
            return 1;
        }else{
            return x * pow(x, n-1);
        }
    }
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        long[] array = new long [n*n + 2*n + 1];
        Arrays.fill(array, 0);
        int index = 0;
        for(int i = 0; i < n+1; i++){
            for(int j = 0; j < n+1; j++){
                array[index++] =  pow(2,i) * pow(5,j);
            }
        }
        Arrays.sort(array);
        for(long x : array){
            System.out.println(x);
        }
    }
}
0