結果

問題 No.500 階乗電卓
ユーザー troro_kelp
提出日時 2018-10-17 01:35:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-12 18:49:14
合計ジャッジ時間 1,353 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 4 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#include <iomanip>
using ll = long long;
using namespace std;

#define MOD 100000000000
ll fac[100010];
int main(void)
{
    ll N;
    cin >> N;
    fac[1] = 1;
    for (ll i = 2; i < 100010; ++i)
    {
        fac[i] = (i * fac[i - 1]) % MOD;
    }
    if (N < 100010)
    {
        cout << setfill('0') << right << setw(12) << fac[N] << endl;
    }
    else
    {
        cout << setfill('0') << left << setw(12) <<  endl;
    }
    return 0;
}
0