結果

問題 No.500 階乗電卓
ユーザー suzusuzu
提出日時 2023-05-24 14:22:24
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 1,992 ms
コンパイル使用メモリ 100,280 KB
実行使用メモリ 22,836 KB
最終ジャッジ日時 2023-08-25 04:37:28
合計ジャッジ時間 4,205 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 55 ms
22,780 KB
testcase_05 AC 53 ms
20,728 KB
testcase_06 AC 55 ms
22,836 KB
testcase_07 AC 54 ms
20,660 KB
testcase_08 AC 53 ms
18,580 KB
testcase_09 AC 54 ms
20,720 KB
testcase_10 AC 54 ms
22,692 KB
testcase_11 AC 55 ms
20,804 KB
testcase_12 AC 55 ms
22,760 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 55 ms
22,736 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.Linq;
using System.Collections.Generic;

namespace yukicoder
{
	class pg
	{
		static void Main(string[] args)
		{
			long N = long.Parse(Console.ReadLine());
			long ans = 1;
			long mod = 1000000000000;
			for(long i = 1;i <= N;i++)
			{
				ans = (ans * i) % mod ;
				if(ans == 0)
				{
					Console.WriteLine(0);
					return;
				}
			}
			
			Console.WriteLine(ans);
		}
	}
}	
0