結果

問題 No.677 10^Nの約数
ユーザー katsumikatsumi
提出日時 2019-01-28 18:38:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 712 bytes
コンパイル時間 2,938 ms
コンパイル使用メモリ 89,696 KB
実行使用メモリ 46,104 KB
最終ジャッジ日時 2024-04-15 11:48:32
合計ジャッジ時間 7,489 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 166 ms
45,480 KB
testcase_01 AC 165 ms
45,812 KB
testcase_02 AC 171 ms
45,900 KB
testcase_03 AC 160 ms
45,516 KB
testcase_04 AC 166 ms
45,632 KB
testcase_05 AC 176 ms
45,684 KB
testcase_06 AC 175 ms
45,596 KB
testcase_07 AC 175 ms
45,464 KB
testcase_08 AC 175 ms
45,636 KB
testcase_09 AC 180 ms
45,912 KB
testcase_10 AC 180 ms
45,760 KB
testcase_11 AC 184 ms
45,756 KB
testcase_12 AC 187 ms
45,676 KB
testcase_13 AC 183 ms
45,656 KB
testcase_14 AC 182 ms
45,916 KB
testcase_15 AC 207 ms
45,596 KB
testcase_16 AC 217 ms
46,104 KB
testcase_17 AC 206 ms
45,588 KB
testcase_18 AC 206 ms
45,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
	
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        
        List<Long> list = new ArrayList<>(1_000_000);
        
        list.add(1L);
        for (int i = 1; i <= N; i++) {
        	long two = (long)Math.pow(2, i);
        	list.add(two);
        	for (int j = 1; j <= N; j++) {
        		long five = (long)Math.pow(5, j);
        		list.add(two * five);
        		list.add(five);
        	}
        }
        
        list.stream().distinct().sorted().forEach(System.out::println);
    }
}

0