結果
問題 |
No.677 10^Nの約数
|
ユーザー |
![]() |
提出日時 | 2018-05-01 07:44:29 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,910 bytes |
コンパイル時間 | 2,055 ms |
コンパイル使用メモリ | 109,824 KB |
実行使用メモリ | 24,704 KB |
最終ジャッジ日時 | 2024-06-28 00:03:22 |
合計ジャッジ時間 | 8,294 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 TLE * 1 -- * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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 = 1; i <= Sqrt(M); ++i) { if(M % i == 0) { divsor.Add(i); divsor.Add(M / i); } } 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(); }