結果

問題 No.210 探し物はどこですか?
ユーザー maine_honzukimaine_honzuki
提出日時 2020-12-22 13:00:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,621 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 2,278 ms
コンパイル使用メモリ 209,032 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-21 12:52:57
合計ジャッジ時間 64,712 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 991 ms
4,348 KB
testcase_01 AC 849 ms
4,348 KB
testcase_02 AC 893 ms
4,348 KB
testcase_03 AC 1,395 ms
4,372 KB
testcase_04 AC 1,367 ms
4,372 KB
testcase_05 AC 1,360 ms
4,348 KB
testcase_06 AC 1,377 ms
4,348 KB
testcase_07 AC 1,372 ms
4,348 KB
testcase_08 AC 1,342 ms
4,348 KB
testcase_09 AC 1,353 ms
4,348 KB
testcase_10 AC 1,342 ms
4,348 KB
testcase_11 AC 1,361 ms
4,348 KB
testcase_12 AC 1,355 ms
4,348 KB
testcase_13 AC 1,484 ms
4,348 KB
testcase_14 AC 1,528 ms
4,348 KB
testcase_15 AC 1,516 ms
4,348 KB
testcase_16 AC 1,484 ms
4,348 KB
testcase_17 AC 1,524 ms
4,348 KB
testcase_18 AC 1,208 ms
4,348 KB
testcase_19 AC 1,227 ms
4,348 KB
testcase_20 AC 1,257 ms
4,348 KB
testcase_21 AC 1,233 ms
4,348 KB
testcase_22 AC 1,241 ms
4,348 KB
testcase_23 AC 1,572 ms
4,348 KB
testcase_24 AC 1,604 ms
4,348 KB
testcase_25 AC 1,592 ms
4,348 KB
testcase_26 AC 1,570 ms
4,348 KB
testcase_27 AC 1,549 ms
4,348 KB
testcase_28 AC 1,122 ms
4,348 KB
testcase_29 AC 1,137 ms
4,348 KB
testcase_30 AC 1,132 ms
4,348 KB
testcase_31 AC 1,133 ms
4,348 KB
testcase_32 AC 1,131 ms
4,348 KB
testcase_33 AC 1,621 ms
4,348 KB
testcase_34 AC 1,586 ms
4,348 KB
testcase_35 AC 1,619 ms
4,348 KB
testcase_36 AC 1,591 ms
4,348 KB
testcase_37 AC 1,586 ms
4,348 KB
testcase_38 AC 1,220 ms
4,348 KB
testcase_39 AC 1,217 ms
4,348 KB
testcase_40 AC 1,204 ms
4,348 KB
testcase_41 AC 1,227 ms
4,348 KB
testcase_42 AC 1,217 ms
4,348 KB
testcase_43 AC 217 ms
4,348 KB
testcase_44 AC 330 ms
4,348 KB
testcase_45 AC 1,382 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<double> P(N), Q(N);
    for (int i = 0; i < N; i++) {
        cin >> P[i];
        P[i] /= 1000;
    }
    for (int i = 0; i < N; i++) {
        cin >> Q[i];
        Q[i] /= 100;
    }

    priority_queue<pair<double, int>> que;
    for (int i = 0; i < N; i++) {
        que.push({P[i] * Q[i], i});
    }

    double ans = 0;
    int num = 1;
    while (num < 1e7) {
        auto p = que.top();
        que.pop();
        ans += num * p.first;
        p.first *= (1 - Q[p.second]);
        que.push(p);
        num++;
    }
    cout << fixed << setprecision(4) << ans << endl;
}
0