結果

問題 No.210 探し物はどこですか?
ユーザー parukiparuki
提出日時 2016-08-20 13:32:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,544 ms / 2,000 ms
コード長 1,128 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 171,524 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 10:50:00
合計ジャッジ時間 60,419 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 924 ms
5,248 KB
testcase_01 AC 797 ms
5,376 KB
testcase_02 AC 846 ms
5,376 KB
testcase_03 AC 1,287 ms
5,376 KB
testcase_04 AC 1,278 ms
5,376 KB
testcase_05 AC 1,322 ms
5,376 KB
testcase_06 AC 1,392 ms
5,376 KB
testcase_07 AC 1,304 ms
5,376 KB
testcase_08 AC 1,248 ms
5,376 KB
testcase_09 AC 1,257 ms
5,376 KB
testcase_10 AC 1,277 ms
5,376 KB
testcase_11 AC 1,281 ms
5,376 KB
testcase_12 AC 1,264 ms
5,376 KB
testcase_13 AC 1,442 ms
5,376 KB
testcase_14 AC 1,446 ms
5,376 KB
testcase_15 AC 1,435 ms
5,376 KB
testcase_16 AC 1,410 ms
5,376 KB
testcase_17 AC 1,481 ms
5,376 KB
testcase_18 AC 1,151 ms
5,376 KB
testcase_19 AC 1,146 ms
5,376 KB
testcase_20 AC 1,182 ms
5,376 KB
testcase_21 AC 1,160 ms
5,376 KB
testcase_22 AC 1,158 ms
5,376 KB
testcase_23 AC 1,496 ms
5,376 KB
testcase_24 AC 1,486 ms
5,376 KB
testcase_25 AC 1,476 ms
5,376 KB
testcase_26 AC 1,487 ms
5,376 KB
testcase_27 AC 1,467 ms
5,376 KB
testcase_28 AC 1,091 ms
5,376 KB
testcase_29 AC 1,119 ms
5,376 KB
testcase_30 AC 1,089 ms
5,376 KB
testcase_31 AC 1,096 ms
5,376 KB
testcase_32 AC 1,095 ms
5,376 KB
testcase_33 AC 1,513 ms
5,376 KB
testcase_34 AC 1,480 ms
5,376 KB
testcase_35 AC 1,544 ms
5,376 KB
testcase_36 AC 1,505 ms
5,376 KB
testcase_37 AC 1,494 ms
5,376 KB
testcase_38 AC 1,173 ms
5,376 KB
testcase_39 AC 1,197 ms
5,376 KB
testcase_40 AC 1,206 ms
5,376 KB
testcase_41 AC 1,204 ms
5,376 KB
testcase_42 AC 1,181 ms
5,376 KB
testcase_43 AC 136 ms
5,376 KB
testcase_44 AC 263 ms
5,376 KB
testcase_45 AC 1,301 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

int N;
vector<double> p, q;

void solve(){
    rep(i, N)p[i] *= 0.001;
    rep(i, N)q[i] *= 0.01;
    int cnt = 0;

    priority_queue<pair<double, int> > Q;
    rep(i, N)Q.push(mp(p[i] * q[i], i));

    double ans = 0;
    rep(iter_, 10000000){
        double x;
        int k;
        tie(x, k) = Q.top();
        Q.pop();
        Q.push(mp(x*(1 - q[k]), k));
        ans += x * ++cnt;
    }

    cout << setprecision(20) << ans << endl;
}

int main(){
    while(cin >> N){
        p.resize(N);
        q.resize(N);
        rep(i, N)scanf("%lf", &p[i]);
        rep(i, N)scanf("%lf", &q[i]);
        solve();
    }
}
0