結果

問題 No.677 10^Nの約数
ユーザー isimiyaisimiya
提出日時 2018-05-23 22:35:42
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 915 bytes
コンパイル時間 849 ms
コンパイル使用メモリ 63,648 KB
実行使用メモリ 24,224 KB
最終ジャッジ日時 2023-09-11 01:59:56
合計ジャッジ時間 3,054 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,740 KB
testcase_01 AC 62 ms
21,872 KB
testcase_02 AC 63 ms
22,024 KB
testcase_03 AC 63 ms
22,068 KB
testcase_04 AC 65 ms
22,212 KB
testcase_05 AC 63 ms
24,148 KB
testcase_06 AC 64 ms
24,088 KB
testcase_07 AC 64 ms
21,976 KB
testcase_08 AC 63 ms
22,040 KB
testcase_09 AC 63 ms
22,176 KB
testcase_10 AC 64 ms
22,172 KB
testcase_11 AC 64 ms
22,216 KB
testcase_12 AC 64 ms
24,164 KB
testcase_13 AC 63 ms
22,056 KB
testcase_14 AC 63 ms
24,208 KB
testcase_15 AC 63 ms
21,964 KB
testcase_16 AC 64 ms
22,048 KB
testcase_17 AC 64 ms
24,224 KB
testcase_18 AC 65 ms
24,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;


class MainClass
{
	public static void Main(string[] args)
	{
		string stdin = Console.ReadLine();
		long N = long.Parse(stdin);
		double d = Math.Pow(10, N);
		long x = (long)d;
		Console.WriteLine(1);
		if (N == 0) return;

		List<long> answer = new List<long>();

		for (int i = 1; i <= N; i++)
		{
			answer.Add((long)Math.Pow(2, i));
			answer.Add((long)Math.Pow(5, i));
		}

		for (int i = 1; i <= N; i++)
		{
			for (int j = 1; j <= N; j++)
			{
				answer.Add((long)(Math.Pow(2, i)) * (long)(Math.Pow(5, j)));
			}
		}

		for (int i = 1; i <= N; i++)
		{
			for (int j = 1; j <= N; j++)
			{
				answer.Add((long)(Math.Pow(5, i)) * (long)(Math.Pow(2, j)));
			}
		}

		answer.Sort();
		IEnumerable<long> result = answer.Distinct();

		long[] data = result.ToArray<long>();

		foreach (long a in data)
		{
			Console.WriteLine(a);
		}
	}
}
0