結果

問題 No.502 階乗を計算するだけ
ユーザー ldsyb
提出日時 2017-04-07 23:30:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 248 bytes
コンパイル時間 637 ms
コンパイル使用メモリ 65,068 KB
実行使用メモリ 13,752 KB
最終ジャッジ日時 2024-07-16 03:08:05
合計ジャッジ時間 3,561 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

using ll = long long;

int main(){
	long long x;
	cin >> x;
	if(1e9 + 7 <= x){
		cout << 0 << endl;
		return 0;
	}
	ll ans = 1;
	for(ll i = 1; i <= x; i++) (ans *= i) %= ll(1e9 + 7);
	cout << ans << endl;
}
0