結果
問題 | No.500 階乗電卓 |
ユーザー |
![]() |
提出日時 | 2017-08-18 14:22:02 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 895 bytes |
コンパイル時間 | 764 ms |
コンパイル使用メモリ | 113,284 KB |
実行使用メモリ | 18,816 KB |
最終ジャッジ日時 | 2024-06-25 03:03:18 |
合計ジャッジ時間 | 2,311 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using System.Numerics;namespace FactCalc{class Program{static void Main(string[] args){BigInteger n = BigInteger.Parse(Console.ReadLine());BigInteger f = Ncalc(n);Console.WriteLine( Formater(f) );}private static string Formater(BigInteger f){string s = f.ToString("#");if (s.Length > 12){s = s.Substring(s.Length - 12, 12);}return s;}private static BigInteger Ncalc(BigInteger n){if( n < 50 ){for (BigInteger i = n - 1; i > 1; i--){n *= i;}}else{n = 1000000000000;}return n;}}}