結果

問題 No.677 10^Nの約数
ユーザー bluemeganebluemegane
提出日時 2018-09-06 19:52:28
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 628 bytes
コンパイル時間 5,295 ms
コンパイル使用メモリ 109,444 KB
実行使用メモリ 22,912 KB
最終ジャッジ日時 2024-05-02 22:09:58
合計ジャッジ時間 7,143 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
22,912 KB
testcase_01 AC 24 ms
18,048 KB
testcase_02 AC 23 ms
18,304 KB
testcase_03 AC 24 ms
17,920 KB
testcase_04 AC 24 ms
18,176 KB
testcase_05 AC 23 ms
18,048 KB
testcase_06 AC 25 ms
18,048 KB
testcase_07 AC 26 ms
18,176 KB
testcase_08 AC 25 ms
18,432 KB
testcase_09 AC 25 ms
17,920 KB
testcase_10 AC 25 ms
18,048 KB
testcase_11 AC 29 ms
18,176 KB
testcase_12 AC 35 ms
18,304 KB
testcase_13 AC 57 ms
18,304 KB
testcase_14 AC 128 ms
18,048 KB
testcase_15 AC 338 ms
18,176 KB
testcase_16 AC 1,018 ms
18,432 KB
testcase_17 TLE -
testcase_18 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        if (n == 0) { Console.WriteLine(1); goto end; }
        var n10 = (long)Math.Pow(10, n);
        var imax = (long)Math.Sqrt(n10);
        var a = new List<long>();
        a.Add(1); a.Add(n10);
        for (long i = 2; i <= imax; i++)
            if (n10 % i == 0)
            {
                a.Add(i);
                if (n10 / i != i) a.Add(n10 / i);
            }
        a.Sort();
        foreach (var x in a) Console.WriteLine(x);
        end:;
    }
}
0