結果
問題 | No.500 階乗電卓 |
ユーザー |
![]() |
提出日時 | 2018-03-14 04:52:21 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 493 ms |
コンパイル使用メモリ | 61,532 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 03:07:16 |
合計ジャッジ時間 | 1,340 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#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);}if(M>=15) cout << setfill('0') << setw(12) << ans << endl;else cout << ans << endl;}return 0;}