結果

問題 No.677 10^Nの約数
ユーザー ohagi_1182ohagi_1182
提出日時 2018-04-29 20:34:09
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 899 bytes
コンパイル時間 2,274 ms
コンパイル使用メモリ 75,672 KB
実行使用メモリ 64,124 KB
最終ジャッジ日時 2023-09-10 08:10:49
合計ジャッジ時間 9,129 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long a = 1;
		for(int i = 0 ; i < n ; i++) a *= 10;
		Map<Long, Long> map = new HashMap<>();
		for(long i = 1 ; i * i <= 1000000000000000000L ; i++) {
			if(a % i == 0) {
				map.put(i, 1L);
				map.put(a / i, 1L);
			}
		}
		List<Entry<Long, Long>> entry = new ArrayList<>(map.entrySet());
		Collections.sort(entry, new Comparator<Entry<Long, Long>>() {
			public int compare(Entry<Long, Long> e1, Entry<Long, Long> e2) {
				return (int)(e1.getKey() - e2.getKey());
			}
		});
		for(Entry<Long, Long> e : entry) {
			System.out.println(e.getKey());
		}
	}
}
0