結果

問題 No.766 金魚すくい
ユーザー kotatsugamekotatsugame
提出日時 2019-01-27 14:27:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 910 ms
コンパイル使用メモリ 71,936 KB
実行使用メモリ 4,424 KB
最終ジャッジ日時 2023-10-24 13:43:14
合計ジャッジ時間 11,203 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
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 AC 7 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 376 ms
4,376 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 AC 385 ms
4,384 KB
testcase_38 AC 380 ms
4,380 KB
testcase_39 AC 397 ms
4,412 KB
testcase_40 AC 369 ms
4,372 KB
testcase_41 AC 373 ms
4,372 KB
testcase_42 AC 354 ms
4,348 KB
testcase_43 AC 2 ms
4,348 KB
testcase_44 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
long mod=1e9+7,v[1<<17];
int n,m,p;
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
main()
{
	cin>>n>>m>>p;
	for(int i=0;i<n;i++)cin>>v[i];
	sort(v,v+n,greater<long>());
	long sumv=0,sump=0,C=1,ans=0;
	for(int k=0;k<n;k++)
	{
		long nowp=power(100-p,k)*power(p,m)%mod*C%mod*power(power(100,m+k),mod-2)%mod;
		sump=(sump+nowp)%mod;
		ans=(ans+nowp*sumv%mod)%mod;
		sumv+=v[k];
		C=C*(m+k)%mod*power(k+1,mod-2)%mod;
	}
	ans=(ans+(1-sump+mod)%mod*sumv%mod)%mod;
	cout<<ans<<endl;
}
0