結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MOD = 1e9 + 7;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin >> n;
	if (n >= MOD) {
		cout << 0 << endl;
	} else {
		ll x = 1;
		for (int i = 2; i <= n; i++) {
			(x *= i) %= MOD;
		}
		cout << x << endl;
	}
	return 0;
}
0