結果

問題 No.500 階乗電卓
ユーザー Mayimg
提出日時 2018-11-27 17:56:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 1,492 ms
コンパイル使用メモリ 166,568 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 20:44:14
合計ジャッジ時間 2,204 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	unsigned long long n, ans = 1, mod = 1e12;
	cin >> n; 
	for(int i = 1; i <= n; i++) {
		ans *= i;
		ans %= mod;
		if(i == 50){
			cout << "000000000000" << endl;
			return 0;
		}
	}
	cout << ans << endl;
	return 0;                                              
}
	
0