結果

問題 No.500 階乗電卓
ユーザー mbanmban
提出日時 2017-04-10 22:44:57
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 618 bytes
コンパイル時間 2,159 ms
コンパイル使用メモリ 103,780 KB
実行使用メモリ 22,916 KB
最終ジャッジ日時 2023-09-25 06:55:06
合計ジャッジ時間 4,647 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

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