結果

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

ソースコード

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 > 0)
		printf("%lld\n", ans);
	else
		printf("%012lld", ans);
	return 0;
}
0