結果

問題 No.210 探し物はどこですか?
ユーザー fumofumofunifumofumofuni
提出日時 2021-03-11 00:39:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,450 bytes
コンパイル時間 1,974 ms
コンパイル使用メモリ 198,444 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 18:18:47
合計ジャッジ時間 3,243 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 6 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 7 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
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 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
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 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 1 ms
5,376 KB
testcase_44 AC 15 ms
5,376 KB
testcase_45 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=(n)-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
 ll MOD=1000000007;
 ll MOD9=998244353;
 int inf=1e9+10;
 ll INF=1e18;
 ll dy[8]={1,0,-1,0,1,1,-1,-1};
 ll dx[8]={0,1,0,-1,1,-1,1,-1};
template <typename T> inline bool chmax(T &a, T b) {
  return ((a < b) ? (a = b, true) : (false));
}
template <typename T> inline bool chmin(T &a, T b) {
  return ((a > b) ? (a = b, true) : (false));
}
using ld=long double;
int main(){
  ll n;cin >> n;
  vector<ld> a(n),b(n);
  rep(i,n)cin >> a[i];rep(i,n)cin >> b[i];
  rep(i,n)a[i]/=1000;rep(i,n)b[i]/=100;
  ld ans=0;
  ld now=1;
  rep(cnt,2000){
    ld t=0;
    ll id=-1;
    rep(i,n){
      if(chmax(t,a[i]*b[i]))id=i;
    }
    ans+=(cnt+1)*now*t;
    now*=(1.0-t);
    ld x=a[id]*(1.0-b[id]);
    ld y=1.0-a[id];
    rep(i,n){
      if(i==id)a[i]=x/(x+y);
      else {
        a[i]/=y;
        a[i]*=1.0-(x/(x+y));
      }
    }
  }
  CST(10);
  cout << ans <<endl;
}
0