結果

問題 No.475 最終日 - Writerの怠慢
ユーザー kotatsugamekotatsugame
提出日時 2020-03-05 15:40:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 605 bytes
コンパイル時間 712 ms
コンパイル使用メモリ 81,576 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 02:34:38
合計ジャッジ時間 1,923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 6 ms
5,376 KB
testcase_04 AC 58 ms
5,376 KB
testcase_05 AC 54 ms
5,376 KB
testcase_06 AC 54 ms
5,376 KB
testcase_07 AC 56 ms
5,376 KB
testcase_08 AC 55 ms
5,376 KB
testcase_09 AC 56 ms
5,376 KB
testcase_10 AC 55 ms
5,376 KB
testcase_11 AC 57 ms
5,376 KB
testcase_12 AC 49 ms
5,376 KB
testcase_13 AC 49 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<iomanip>
using namespace std;
int N,wid;
long S,A[1<<17];
main()
{
	cin>>N>>S>>wid;
	for(int i=0;i<N;i++)cin>>A[i];
	long WA=A[wid]+100*S;
	vector<int>T;
	for(int i=0;i<N;i++)
	{
		if(i==wid)continue;
		long rest=WA-A[i];
		long L=0,R=N+5;
		while(R-L>1)
		{
			long M=(L+R)/2;
			if(100*S*(9+M)/(8+2*M)<=rest)R=M;
			else L=M;
		}
		T.push_back(R);
	}
	sort(T.begin(),T.end());
	double ans=1;
	int ti=0;
	for(int i=1;i<N;i++)
	{
		while(ti<T.size()&&T[ti]<=i)ti++;
		ans=ans*(ti-i+1)/(N-i);
	}
	cout<<fixed<<setprecision(16)<<ans<<endl;
}
0