結果

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

ソースコード

diff #

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