結果

問題 No.502 階乗を計算するだけ
ユーザー kurenai3110
提出日時 2017-04-07 23:12:46
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 348 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 66,224 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-07-16 02:58:31
合計ジャッジ時間 3,557 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
using namespace std;
#define MOD (int)(1e9+7)

int main()
{
	long long n;
	cin >> n;

	if (n >= MOD)cout << 0 << endl;
	else {
		long long a = 1;
		for (long long i = n; i >= 1; i--) {
			a *= i;
			a %= MOD;
		}
		cout << a << endl;
	}

	return 0;
}

0