結果

問題 No.500 階乗電卓
ユーザー mbanmban
提出日時 2017-04-10 22:47:49
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 105,308 KB
実行使用メモリ 22,920 KB
最終ジャッジ日時 2023-09-25 06:55:16
合計ジャッジ時間 4,446 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
22,680 KB
testcase_01 AC 55 ms
20,760 KB
testcase_02 AC 56 ms
22,676 KB
testcase_03 AC 55 ms
20,700 KB
testcase_04 AC 55 ms
22,752 KB
testcase_05 AC 55 ms
20,632 KB
testcase_06 AC 56 ms
22,844 KB
testcase_07 AC 55 ms
20,768 KB
testcase_08 AC 55 ms
20,752 KB
testcase_09 AC 57 ms
20,564 KB
testcase_10 AC 56 ms
20,748 KB
testcase_11 AC 56 ms
22,668 KB
testcase_12 AC 54 ms
18,768 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 56 ms
22,808 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 55 ms
22,688 KB
testcase_19 AC 54 ms
20,768 KB
testcase_20 AC 54 ms
20,784 KB
testcase_21 AC 54 ms
20,724 KB
testcase_22 AC 53 ms
20,716 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        new Magatro().Solve();
    }
}

public class Magatro
{
    private long N = long.Parse(Console.ReadLine());
    long Mod = 1000000000000;
    public void Solve()
    {
        long ans;
        if (N > 100)
        {
            Console.WriteLine("000000000000");
        }
        else
        {
            ans = 1;
            for (long i = 1; i <= N; i++)
            {
                ans *= i;
                ans %= Mod;
            }
            Console.WriteLine(ans);
        }
    }
}
0