結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2025-06-21 12:00:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 320 bytes |
コンパイル時間 | 1,311 ms |
コンパイル使用メモリ | 161,336 KB |
実行使用メモリ | 19,144 KB |
最終ジャッジ日時 | 2025-06-21 12:00:59 |
合計ジャッジ時間 | 8,012 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 19 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define int ll const int mod=1e12; int n,res=1; signed main(){ cin>>n; for(int i=1;i<=n;i++)res=res*i%mod; if(n<=14)cout<<res; else{ int sum=0,cnt=res; while(cnt){ sum++; cnt/=10; } for(int i=1;i<=12-sum;i++)cout<<0; cout<<res; } }