結果
| 問題 |
No.475 最終日 - Writerの怠慢
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-05 15:40:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 2,000 ms |
| コード長 | 605 bytes |
| コンパイル時間 | 718 ms |
| コンパイル使用メモリ | 81,184 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 01:16:56 |
| 合計ジャッジ時間 | 2,102 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
8 | main()
| ^~~~
ソースコード
#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;
}