結果

問題 No.677 10^Nの約数
ユーザー bluemegane
提出日時 2018-09-06 19:52:28
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 628 bytes
コンパイル時間 4,375 ms
コンパイル使用メモリ 102,656 KB
実行使用メモリ 34,560 KB
最終ジャッジ日時 2024-11-23 17:06:53
合計ジャッジ時間 11,509 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 TLE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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