結果

問題 No.502 階乗を計算するだけ
ユーザー y_taira_c
提出日時 2017-06-21 22:52:51
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 410 bytes
コンパイル時間 744 ms
コンパイル使用メモリ 89,336 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-10-02 11:53:14
合計ジャッジ時間 4,010 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <future>
#include <iostream>

using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	int x;
	cin >> x;

	unsigned long long int res = 1;
	thread t = thread([&res](int x) 
	{
		for (int i = x; i > 0; i--)
		{
			res *= i;
			res %= 1000000007;
		}
	},x/2);
	t.join();


	
	for (int i = x; i > x/2; i--)
	{
		res *= i;
		res %= 1000000007;
	}
	cout << res << "\n";

	return 0;
}
0