結果

問題 No.210 探し物はどこですか?
ユーザー koprickykopricky
提出日時 2017-08-02 15:36:36
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 569 ms / 2,000 ms
コード長 1,201 bytes
コンパイル時間 1,491 ms
コンパイル使用メモリ 164,748 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 13:32:07
合計ジャッジ時間 22,169 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 324 ms
5,248 KB
testcase_01 AC 396 ms
5,376 KB
testcase_02 AC 414 ms
5,376 KB
testcase_03 AC 365 ms
5,376 KB
testcase_04 AC 347 ms
5,376 KB
testcase_05 AC 344 ms
5,376 KB
testcase_06 AC 348 ms
5,376 KB
testcase_07 AC 354 ms
5,376 KB
testcase_08 AC 352 ms
5,376 KB
testcase_09 AC 354 ms
5,376 KB
testcase_10 AC 345 ms
5,376 KB
testcase_11 AC 349 ms
5,376 KB
testcase_12 AC 342 ms
5,376 KB
testcase_13 AC 401 ms
5,376 KB
testcase_14 AC 409 ms
5,376 KB
testcase_15 AC 417 ms
5,376 KB
testcase_16 AC 402 ms
5,376 KB
testcase_17 AC 421 ms
5,376 KB
testcase_18 AC 353 ms
5,376 KB
testcase_19 AC 351 ms
5,376 KB
testcase_20 AC 366 ms
5,376 KB
testcase_21 AC 360 ms
5,376 KB
testcase_22 AC 361 ms
5,376 KB
testcase_23 AC 469 ms
5,376 KB
testcase_24 AC 482 ms
5,376 KB
testcase_25 AC 482 ms
5,376 KB
testcase_26 AC 478 ms
5,376 KB
testcase_27 AC 489 ms
5,376 KB
testcase_28 AC 534 ms
5,376 KB
testcase_29 AC 537 ms
5,376 KB
testcase_30 AC 533 ms
5,376 KB
testcase_31 AC 542 ms
5,376 KB
testcase_32 AC 532 ms
5,376 KB
testcase_33 AC 534 ms
5,376 KB
testcase_34 AC 527 ms
5,376 KB
testcase_35 AC 533 ms
5,376 KB
testcase_36 AC 558 ms
5,376 KB
testcase_37 AC 526 ms
5,376 KB
testcase_38 AC 559 ms
5,376 KB
testcase_39 AC 561 ms
5,376 KB
testcase_40 AC 559 ms
5,376 KB
testcase_41 AC 569 ms
5,376 KB
testcase_42 AC 562 ms
5,376 KB
testcase_43 AC 65 ms
5,376 KB
testcase_44 AC 121 ms
5,376 KB
testcase_45 AC 355 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a, b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define show(x) cout <<#x<<" = "<<(x)<<endl
#define spair(p) cout <<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout <<" "<<kbrni;cout<<endl

using namespace std;

typedef pair<double,int>P;

const int MAX_N = 100005;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<double> p(n);
    vector<double> q(n);
    rep(i,n){
        cin >> p[i];
        p[i] /= 1000;
    }
    rep(i,n){
        cin >> q[i];
        q[i] /= 100;
    }
    priority_queue<P> que;
    rep(i,n){
        que.push(P(p[i]*q[i],i));
    }
    double prob = 0;
    double ans = 0;
    rep(i,5000005){
        P a = que.top();
        que.pop();
        ans += 1-prob;
        prob += a.fi;
        que.push(P(a.fi*(1-q[a.se]),a.se));
    }
    printf("%.10lf\n",ans);
    return 0;
}
0