結果
| 問題 | No.500 階乗電卓 |
| コンテスト | |
| ユーザー |
mori_chibi
|
| 提出日時 | 2017-08-18 11:49:54 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 610 bytes |
| 記録 | |
| コンパイル時間 | 1,037 ms |
| コンパイル使用メモリ | 103,936 KB |
| 実行使用メモリ | 1,319,168 KB |
| 最終ジャッジ日時 | 2026-05-02 01:14:43 |
| 合計ジャッジ時間 | 4,463 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | MLE * 2 -- * 18 |
コンパイルメッセージ
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;
}
}
}
mori_chibi