結果

問題 No.500 階乗電卓
ユーザー snrnsidy
提出日時 2025-10-07 01:17:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 819 ms
コンパイル使用メモリ 94,020 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-10-07 01:17:58
合計ジャッジ時間 1,963 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <unordered_set>
#include <cstring>
#include <queue>
#include <bitset>
#include <map>
#include <stack>

using namespace std;

const long long int MOD = 1e12;
int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);


	long long int n;

	cin >> n;
	if(n>=50)
	{
		cout << "000000000000" << '\n';
	}
	else
	{
		long long val = 1;
		for(int i=1;i<=n;i++)	
		{
			val*=i;
			val%=MOD;
		}		
		cout << val << '\n';
	}
	return 0;
}
0