結果
| 問題 | No.677 10^Nの約数 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-04-27 22:30:28 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 76 ms / 2,000 ms | 
| コード長 | 841 bytes | 
| コンパイル時間 | 1,997 ms | 
| コンパイル使用メモリ | 74,700 KB | 
| 実行使用メモリ | 52,388 KB | 
| 最終ジャッジ日時 | 2024-06-27 21:54:22 | 
| 合計ジャッジ時間 | 3,821 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 17 | 
ソースコード
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);
        }
    }
}
            
            
            
        