結果

問題 No.500 階乗電卓
ユーザー YukiDarumaYukiDaruma
提出日時 2017-04-07 22:42:30
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,005 bytes
コンパイル時間 2,312 ms
コンパイル使用メモリ 143,240 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-07 08:30:22
合計ジャッジ時間 3,058 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main( int argc, char *argv[] )
{
const char *lpAns[] =
{
"1",
"2",
"6",
"24",
"120",
"720",
"5040",
"40320",
"362880",
"3628800",
"39916800",
"479001600",
"6227020800",
"87178291200",
"307674368000",
"922789888000",
"687428096000",
"373705728000",
"100408832000",
"008176640000",
"171709440000",
"777607680000",
"884976640000",
"239439360000",
"985984000000",
"635584000000",
"160768000000",
"501504000000",
"543616000000",
"308480000000",
"562880000000",
"012160000000",
"401280000000",
"643520000000",
"523200000000",
"835200000000",
"902400000000",
"291200000000",
"356800000000",
"272000000000",
"152000000000",
"384000000000",
"512000000000",
"528000000000",
"760000000000",
"960000000000",
"120000000000",
"760000000000",
"240000000000",
"000000000000"
};

const long long iMod = 1000000000000;
long long N;

	// 入力
	cin >> N;

	// 出力
	if( N >= 50 )
		cout << lpAns[ 49 ] << endl;
	else
		cout << lpAns[ N - 1 ] << endl;

	return 0;
}




0