結果

問題 No.500 階乗電卓
ユーザー pengin_2000
提出日時 2021-10-22 23:53:22
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 07:09:56
合計ジャッジ時間 1,026 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
	long long int n;
	scanf("%lld", &n);
	if (n >= 50)
	{
		printf("000000000000\n");
		return 0;
	}
	long long int ans = 1, i, p = 1e12;
	for (i = 1; i <= 50 && i <= n; i++)
		ans = ans * i % p;
	if (n < 26)
		printf("%lld\n", ans);
	else
		printf("%012lld\n", ans);
	return 0;
}
0