結果

問題 No.210 探し物はどこですか?
ユーザー fumofumofunifumofumofuni
提出日時 2021-03-11 00:42:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,452 bytes
コンパイル時間 2,212 ms
コンパイル使用メモリ 197,240 KB
実行使用メモリ 14,016 KB
最終ジャッジ日時 2024-04-20 18:21:39
合計ジャッジ時間 14,462 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
10,148 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1,356 ms
6,944 KB
testcase_04 AC 1,352 ms
6,940 KB
testcase_05 AC 15 ms
6,944 KB
testcase_06 AC 1,374 ms
6,944 KB
testcase_07 AC 13 ms
6,940 KB
testcase_08 AC 1,161 ms
6,944 KB
testcase_09 AC 15 ms
6,940 KB
testcase_10 AC 1,212 ms
6,944 KB
testcase_11 AC 14 ms
6,940 KB
testcase_12 AC 13 ms
6,940 KB
testcase_13 AC 108 ms
6,944 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

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,200000){
    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