結果
| 問題 | No.500 階乗電卓 |
| コンテスト | |
| ユーザー |
RIGIH
|
| 提出日時 | 2017-06-26 23:23:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 377 bytes |
| コンパイル時間 | 575 ms |
| コンパイル使用メモリ | 58,588 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-25 03:02:35 |
| 合計ジャッジ時間 | 1,351 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#include<stdio.h>
#include <iostream>
#include <cstring>
#include <math.h>
using namespace std;
int main(){
int n;
cin>>n;
if(n>=50){
cout<<"000000000000"<<endl;
return 0;
}
long long a=1;
for(int i=1;i<=n;i++){
a=(a*i)%1000000000000;
//cout<<a<<endl;
}
if(n>14){
cout.width(12);
cout.fill('0');
}
cout<<a<<endl;
return 0;
}
RIGIH