結果

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

ソースコード

diff #

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

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