結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 13 ms
5,376 KB
testcase_04 AC 8 ms
5,376 KB
testcase_05 AC 6 ms
5,376 KB
testcase_06 AC 12 ms
5,376 KB
testcase_07 AC 7 ms
5,376 KB
testcase_08 AC 5 ms
5,376 KB
testcase_09 AC 5 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 5 ms
5,376 KB
testcase_12 AC 5 ms
5,376 KB
testcase_13 AC 7 ms
5,376 KB
testcase_14 AC 8 ms
5,376 KB
testcase_15 AC 7 ms
5,376 KB
testcase_16 AC 8 ms
5,376 KB
testcase_17 AC 8 ms
5,376 KB
testcase_18 AC 8 ms
5,376 KB
testcase_19 AC 8 ms
5,376 KB
testcase_20 AC 9 ms
5,376 KB
testcase_21 AC 9 ms
5,376 KB
testcase_22 AC 9 ms
5,376 KB
testcase_23 AC 11 ms
5,376 KB
testcase_24 AC 11 ms
5,376 KB
testcase_25 AC 11 ms
5,376 KB
testcase_26 AC 11 ms
5,376 KB
testcase_27 AC 10 ms
5,376 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 14 ms
5,376 KB
testcase_34 AC 13 ms
5,376 KB
testcase_35 AC 14 ms
5,376 KB
testcase_36 AC 14 ms
5,376 KB
testcase_37 AC 14 ms
5,376 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 3 ms
5,376 KB
testcase_44 AC 4 ms
5,376 KB
testcase_45 AC 13 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_, 100000){
        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