結果

問題 No.677 10^Nの約数
ユーザー bluemeganebluemegane
提出日時 2018-09-06 19:46:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 4,173 ms
コンパイル使用メモリ 102,656 KB
実行使用メモリ 34,048 KB
最終ジャッジ日時 2024-05-02 22:00:02
合計ジャッジ時間 8,968 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 26 ms
17,792 KB
testcase_02 AC 27 ms
17,920 KB
testcase_03 AC 26 ms
17,920 KB
testcase_04 AC 27 ms
17,920 KB
testcase_05 AC 27 ms
17,920 KB
testcase_06 AC 27 ms
18,048 KB
testcase_07 AC 27 ms
17,792 KB
testcase_08 AC 27 ms
17,792 KB
testcase_09 AC 28 ms
17,920 KB
testcase_10 AC 28 ms
17,920 KB
testcase_11 AC 31 ms
18,048 KB
testcase_12 AC 41 ms
18,048 KB
testcase_13 AC 66 ms
18,048 KB
testcase_14 AC 148 ms
18,176 KB
testcase_15 AC 402 ms
18,304 KB
testcase_16 AC 1,210 ms
17,920 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());
        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);
    }
}
0