結果

問題 No.677 10^Nの約数
ユーザー taktak
提出日時 2018-05-01 07:59:43
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 1,979 bytes
コンパイル時間 2,982 ms
コンパイル使用メモリ 109,360 KB
実行使用メモリ 24,436 KB
最終ジャッジ日時 2023-09-10 08:36:20
合計ジャッジ時間 4,743 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
22,080 KB
testcase_01 AC 66 ms
24,392 KB
testcase_02 AC 67 ms
22,296 KB
testcase_03 AC 66 ms
24,380 KB
testcase_04 AC 66 ms
22,344 KB
testcase_05 AC 66 ms
22,200 KB
testcase_06 AC 66 ms
24,304 KB
testcase_07 AC 66 ms
20,308 KB
testcase_08 AC 65 ms
22,388 KB
testcase_09 AC 66 ms
22,384 KB
testcase_10 AC 66 ms
22,296 KB
testcase_11 AC 66 ms
22,292 KB
testcase_12 AC 66 ms
22,300 KB
testcase_13 AC 67 ms
22,204 KB
testcase_14 AC 69 ms
22,276 KB
testcase_15 AC 67 ms
24,436 KB
testcase_16 AC 66 ms
22,252 KB
testcase_17 AC 67 ms
24,240 KB
testcase_18 AC 66 ms
22,276 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Text;
using static System.Console;
using static System.Math;
class Simple {
    private int N;
    void Solve() {
        N = io.Int;
        var M = (long)Pow(10, N);
        var divsor = new List <long>();
        for(int i = 0; Pow(2, i) <= M; ++i) {
            for(int j = 0; Pow(5, j) <= M; ++j) {
                var cur = (long)(Pow(2, i) * Pow(5, j));
                if(M % cur == 0)
                    divsor.Add(cur);
            }
        }
        foreach(var v in divsor.Distinct().OrderBy(x => x))
            WriteLine(v);
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) => new Simple().Stream();
    private void Stream() {
        //var exStdIn = new System.IO.StreamReader("stdin.txt");
        //SetIn(exStdIn);
        Solve();
        io.Flush();
    }
}
class SimpleIO {
    string[] _nextBuffer;
    int _bufferCnt;
    char[] cs = new char[] {' ', '"', ','};
    StreamWriter sw = new StreamWriter(OpenStandardOutput()) {
#if DEBUG
        AutoFlush = true
#else
        AutoFlush = false
#endif
    };
    public SimpleIO() {
        _nextBuffer = new string[0];
        _bufferCnt = 0;
        SetOut(sw);
    }
    string Next() {
        if(_bufferCnt < _nextBuffer.Length)
            return _nextBuffer[_bufferCnt++];
        var st = ReadLine();
        while(st == "")
            st = ReadLine();
        _nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        _bufferCnt = 0;
        return _nextBuffer[_bufferCnt++];
    }
    public string String => Next();
    public char Char     => char.Parse(String);
    public int Int       => int.Parse(String);
    public long Long     => long.Parse(String);
    public double Double => double.Parse(String);
    public void Flush()  => Out.Flush();
}
0