結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2017-08-18 11:49:54 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 610 bytes |
コンパイル時間 | 2,529 ms |
コンパイル使用メモリ | 103,168 KB |
実行使用メモリ | 828,588 KB |
最終ジャッジ日時 | 2024-10-14 14:49:34 |
合計ジャッジ時間 | 5,753 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | MLE * 1 -- * 19 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace FactCalc { class Program { static void Main(string[] args) { Decimal n = Decimal.Parse(Console.ReadLine()); Decimal f = Ncalc(n); Console.WriteLine( Formater(f) ); } private static string Formater(decimal f) { string s = f.ToString("#"); if (s.Length > 12) s = s.Substring(s.Length - 12, 12); return s; } private static decimal Ncalc(decimal n) { if (n - 1 < 2) return n; return Ncalc(n - 1) * n; } } }