結果
問題 |
No.677 10^Nの約数
|
ユーザー |
![]() |
提出日時 | 2018-04-29 20:34:09 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 899 bytes |
コンパイル時間 | 2,810 ms |
コンパイル使用メモリ | 86,356 KB |
実行使用メモリ | 52,320 KB |
最終ジャッジ日時 | 2024-06-27 23:40:19 |
合計ジャッジ時間 | 8,751 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | TLE * 1 -- * 16 |
ソースコード
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()); } } }