結果

問題 No.475 最終日 - Writerの怠慢
ユーザー hashiryohashiryo
提出日時 2019-05-12 18:23:28
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,409 bytes
コンパイル時間 1,133 ms
コンパイル使用メモリ 97,600 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-18 08:40:46
合計ジャッジ時間 1,935 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 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 AC 13 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <float.h>
#include <random>

#define repeat(i,n) for (int i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n'
#define debugArrayP(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge].first<< " " << x[hoge].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = LLONG_MAX/10;
const ll MOD = 1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  ll S;
  int writer_id;cin>>N>>S>>writer_id;
  vll a(N);
  repeat(i,N){
    cin>>a[i];
    if(i==writer_id)swap(a[0],a[i]);
  }
  sort(a.begin()+1,a.end());
  //debugArray(a,N);
  double ans = 1;
  int R=1;
  for(int i=1;i<N;i++){
    while(R<=N-1&&a[0]+100*S<a[i]+50*S+500*S/(8+2*R))R++;
    //debug(R);
    if(i-R+1<=0)ans *= 0;
    else ans *= (double)(i-R+1)/(N-i);
  }
  printf("%.10lf\n",ans);
  return 0;
}
0