結果

問題 No.677 10^Nの約数
ユーザー tsunabittsunabit
提出日時 2019-06-23 11:20:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 2,883 ms
コンパイル使用メモリ 84,360 KB
実行使用メモリ 41,268 KB
最終ジャッジ日時 2024-06-07 23:18:42
合計ジャッジ時間 5,889 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
40,168 KB
testcase_01 AC 117 ms
40,076 KB
testcase_02 AC 99 ms
39,968 KB
testcase_03 AC 103 ms
40,500 KB
testcase_04 AC 104 ms
40,348 KB
testcase_05 AC 113 ms
41,200 KB
testcase_06 AC 120 ms
41,132 KB
testcase_07 AC 110 ms
40,252 KB
testcase_08 AC 119 ms
41,120 KB
testcase_09 AC 117 ms
41,224 KB
testcase_10 AC 113 ms
40,096 KB
testcase_11 AC 118 ms
41,260 KB
testcase_12 AC 107 ms
40,084 KB
testcase_13 AC 124 ms
40,244 KB
testcase_14 AC 141 ms
41,268 KB
testcase_15 AC 141 ms
41,248 KB
testcase_16 AC 122 ms
40,184 KB
testcase_17 AC 117 ms
40,364 KB
testcase_18 AC 125 ms
41,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No677 {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	long[] a2 = new long[n+1];
    	long[] a5 = new long[n+1];
    	for(int i = 0; i <= n; i++) {
    		a2[i] = (long)Math.pow(2, i);
    		a5[i] = (long)Math.pow(5, i);
    	}
    	Map<Long, Integer> map = new TreeMap<Long, Integer>();
    	for(int i = 0; i <= n; i++) {
    		for(int j = 0; j <= n; j++) {
    			map.put(a2[i] * a5[j], 1);
    		}
    	}
    	for(long k : map.keySet()) {
    		System.out.println(k);
    	}
    }
}
0