結果
問題 |
No.677 10^Nの約数
|
ユーザー |
![]() |
提出日時 | 2018-05-23 22:35:42 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 915 bytes |
コンパイル時間 | 933 ms |
コンパイル使用メモリ | 110,140 KB |
実行使用メモリ | 19,584 KB |
最終ジャッジ日時 | 2024-06-28 16:31:42 |
合計ジャッジ時間 | 2,226 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Generic; using System.Linq; class MainClass { public static void Main(string[] args) { string stdin = Console.ReadLine(); long N = long.Parse(stdin); double d = Math.Pow(10, N); long x = (long)d; Console.WriteLine(1); if (N == 0) return; List<long> answer = new List<long>(); for (int i = 1; i <= N; i++) { answer.Add((long)Math.Pow(2, i)); answer.Add((long)Math.Pow(5, i)); } for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { answer.Add((long)(Math.Pow(2, i)) * (long)(Math.Pow(5, j))); } } for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { answer.Add((long)(Math.Pow(5, i)) * (long)(Math.Pow(2, j))); } } answer.Sort(); IEnumerable<long> result = answer.Distinct(); long[] data = result.ToArray<long>(); foreach (long a in data) { Console.WriteLine(a); } } }