結果

問題 No.500 階乗電卓
ユーザー face4
提出日時 2018-05-16 22:43:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 72,740 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 13:21:42
合計ジャッジ時間 1,466 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long ll;
#define MOD 1000000000000

int main(){
    ll n;
    cin >> n;
    if(n >= 50) cout << "000000000000" << endl;
    else{
        ll ans = 1;
        for(ll i = n; i >= 2; i--){
            ans *= i;
            ans %= MOD;
        }
        cout <<ans << endl;
    }

    return 0;
}
0