結果
| 問題 | No.575 n! / m / m / m... |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-07 14:49:20 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 904 ms |
| コンパイル使用メモリ | 173,488 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-12 05:56:04 |
| 合計ジャッジ時間 | 3,603 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 14 |
ソースコード
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll n,m;
double ume[1001]={};
int main(void){
scanf("%lld%lld",&n,&m);
ll cnt=0;
ll np=n;
while(np>=m){
cnt+=np/m;
np/=m;
}
long double sum=lgammal(n+1LL);
sum/=log(10);
long double nex=log10l(m);
sum-=(long double)nex*cnt;
ll resp=sum;
double rest=(long double)sum-resp;
printf("%.5fe%lld\n",pow(10,rest),resp);
return 0;
}