結果

問題 No.475 最終日 - Writerの怠慢
ユーザー kotatsugamekotatsugame
提出日時 2020-03-05 15:39:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 789 ms
コンパイル使用メモリ 81,864 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-22 02:34:24
合計ジャッジ時間 2,295 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
6,940 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)/i;
	}
	cout<<fixed<<setprecision(16)<<ans<<endl;
}
0