結果

問題 No.575 n! / m / m / m...
ユーザー ryoissyryoissy
提出日時 2017-10-07 14:48:17
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 1,356 ms
コンパイル使用メモリ 157,784 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 12:48:00
合計ジャッジ時間 4,433 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%lld%lld",&n,&m);
      |         ~~~~~^~~~~~~~~~~~~~~~~~

ソースコード

diff #

#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("%.10fe%lld\n",pow(10,rest),resp);
	return 0;
}
0