結果

問題 No.500 階乗電卓
ユーザー eve__fuyuki
提出日時 2018-03-14 04:50:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 62,564 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-24 23:07:57
合計ジャッジ時間 1,402 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main(){
    long long M;
    long long ans = 1;
    cin >> M;
    if(M >= 50) cout << "000000000000" << endl;
    else{
        for(long long i=2;i<=M;i++){
            ans = (ans*i)%(1000000000000);
        }
        cout << setfill('0') << setw(12) << ans << endl;
    }
    return 0;
}
0