結果
| 問題 |
No.677 10^Nの約数
|
| コンテスト | |
| ユーザー |
tak
|
| 提出日時 | 2018-05-01 07:59:43 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 1,979 bytes |
| コンパイル時間 | 1,417 ms |
| コンパイル使用メモリ | 109,824 KB |
| 実行使用メモリ | 19,712 KB |
| 最終ジャッジ日時 | 2024-06-28 00:03:27 |
| 合計ジャッジ時間 | 2,809 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
コンパイルメッセージ
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 = 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();
}
tak