結果

問題 No.677 10^Nの約数
ユーザー tsunabittsunabit
提出日時 2019-06-23 11:20:39
言語 Java19
(openjdk 21)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 4,295 ms
コンパイル使用メモリ 72,684 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2023-08-27 03:22:30
合計ジャッジ時間 7,261 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,816 KB
testcase_01 AC 129 ms
56,112 KB
testcase_02 AC 126 ms
56,164 KB
testcase_03 AC 125 ms
55,600 KB
testcase_04 AC 125 ms
55,908 KB
testcase_05 AC 131 ms
55,660 KB
testcase_06 AC 131 ms
55,908 KB
testcase_07 AC 132 ms
56,120 KB
testcase_08 AC 132 ms
55,928 KB
testcase_09 AC 133 ms
55,900 KB
testcase_10 AC 134 ms
56,056 KB
testcase_11 AC 141 ms
55,848 KB
testcase_12 AC 140 ms
55,812 KB
testcase_13 AC 142 ms
55,948 KB
testcase_14 AC 143 ms
56,112 KB
testcase_15 AC 150 ms
56,116 KB
testcase_16 AC 149 ms
56,136 KB
testcase_17 AC 163 ms
56,348 KB
testcase_18 AC 156 ms
56,220 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