結果

問題 No.677 10^Nの約数
ユーザー YamaKasaYamaKasa
提出日時 2018-06-06 23:17:24
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 651 bytes
コンパイル時間 2,176 ms
コンパイル使用メモリ 72,608 KB
実行使用メモリ 57,624 KB
最終ジャッジ日時 2023-09-12 22:55:06
合計ジャッジ時間 5,794 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 122 ms
55,628 KB
testcase_02 AC 122 ms
55,608 KB
testcase_03 AC 122 ms
55,700 KB
testcase_04 AC 126 ms
55,428 KB
testcase_05 AC 129 ms
55,936 KB
testcase_06 AC 130 ms
56,020 KB
testcase_07 AC 134 ms
57,624 KB
testcase_08 AC 135 ms
56,068 KB
testcase_09 AC 135 ms
55,712 KB
testcase_10 AC 139 ms
55,708 KB
testcase_11 AC 141 ms
56,224 KB
testcase_12 AC 144 ms
56,016 KB
testcase_13 AC 150 ms
55,900 KB
testcase_14 AC 150 ms
55,696 KB
testcase_15 AC 158 ms
55,616 KB
testcase_16 AC 177 ms
55,632 KB
testcase_17 AC 160 ms
56,176 KB
testcase_18 AC 167 ms
56,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		scan.close();
		Set<Long> set = new TreeSet<Long>();
		Set<Long> set2 = new TreeSet<Long>();
		Long []M = {1L, 2L, 5L, 10L};
		set.add(1L);
		set.add(2L);
		set.add(5L);
		set.add(10L);

		for(int i = 0; i < N - 1; i++) {
			for(Long t1 : set) {
				for(Long t2 : M) {
					long t3 = t1 * t2;
					set2.add(t3);
				}
			}
			for(Long k : set2) {
				set.add(k);
			}
			set2.clear();
		}
		for(long t : set) {
			System.out.println(t);
		}
	}
}
0