結果

問題 No.500 階乗電卓
ユーザー vjudge1
提出日時 2025-06-21 12:08:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 1,466 ms
コンパイル使用メモリ 161,280 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-21 12:08:42
合計ジャッジ時間 2,476 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
const int mod=1e12;
int n,res=1;
signed main(){
	cin>>n;
	if(n>=50){
		cout<<"000000000000";
		return 0;
	}
	for(int i=1;i<=n;i++)res=res*i%mod;
	cout<<res;
//	else{
//		int sum=0,cnt=res;
//		while(cnt){
//			sum++;
//			cnt/=10;
//		}
//		for(int i=1;i<=12-sum;i++)cout<<0;
//		cout<<res;
//	}
}
0