結果

問題 No.677 10^Nの約数
ユーザー htensaihtensai
提出日時 2019-11-12 08:23:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 2,378 ms
コンパイル使用メモリ 77,060 KB
実行使用メモリ 57,772 KB
最終ジャッジ日時 2023-10-17 12:56:52
合計ジャッジ時間 5,894 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
57,516 KB
testcase_01 AC 133 ms
57,656 KB
testcase_02 AC 132 ms
57,564 KB
testcase_03 AC 133 ms
57,508 KB
testcase_04 AC 134 ms
57,544 KB
testcase_05 AC 134 ms
57,540 KB
testcase_06 AC 136 ms
57,500 KB
testcase_07 AC 134 ms
57,512 KB
testcase_08 AC 138 ms
57,772 KB
testcase_09 AC 135 ms
57,512 KB
testcase_10 AC 135 ms
57,472 KB
testcase_11 AC 136 ms
57,472 KB
testcase_12 AC 137 ms
57,556 KB
testcase_13 AC 137 ms
57,604 KB
testcase_14 AC 135 ms
57,468 KB
testcase_15 AC 140 ms
57,448 KB
testcase_16 AC 139 ms
57,544 KB
testcase_17 AC 139 ms
57,524 KB
testcase_18 AC 141 ms
57,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		PriorityQueue<Long> queue = new PriorityQueue<>();
		for (int i = 0; i <= n; i++) {
		    for (int j = 0; j <= n; j++) {
		        queue.add((long)(Math.pow(2, i) * Math.pow(5, j)));
		    }
		}
		StringBuilder sb = new StringBuilder();
		while (queue.size() > 0) {
		    sb.append(queue.poll()).append("\n");
		}
		System.out.print(sb);
   }
}

0