結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
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 = 1e7 <= x ? 289849022 : 1;
	for(ll i = 1e7 <= x ? 1e7 + 1 : 2; i <= x; i++) (ans *= i) %= ll(1e9 + 7);
	cout << ans << endl;
}
0