結果

問題 No.500 階乗電卓
ユーザー mbanmban
提出日時 2017-04-10 22:45:53
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 623 bytes
コンパイル時間 2,030 ms
コンパイル使用メモリ 101,668 KB
実行使用メモリ 24,740 KB
最終ジャッジ日時 2023-09-25 06:55:11
合計ジャッジ時間 4,575 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 55 ms
22,764 KB
testcase_05 AC 54 ms
20,896 KB
testcase_06 AC 55 ms
18,836 KB
testcase_07 AC 57 ms
20,780 KB
testcase_08 AC 55 ms
22,652 KB
testcase_09 AC 56 ms
20,792 KB
testcase_10 AC 55 ms
22,668 KB
testcase_11 AC 54 ms
20,632 KB
testcase_12 AC 54 ms
20,792 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 55 ms
20,760 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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()
    {
        if (N > 100)
        {
            Console.WriteLine(0);
            return;
        }
        else
        {
            long ans = 1;
            for (long i = 1; i <= N; i++)
            {
                ans *= i;
                ans %= Mod;
            }
            Console.WriteLine(ans);
        }
    }
}
0