結果

問題 No.210 探し物はどこですか?
ユーザー KKT89KKT89
提出日時 2022-03-28 02:26:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,486 bytes
コンパイル時間 1,496 ms
コンパイル使用メモリ 139,184 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 11:17:57
合計ジャッジ時間 3,115 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 8 ms
5,376 KB
testcase_04 AC 6 ms
5,376 KB
testcase_05 AC 5 ms
5,376 KB
testcase_06 AC 9 ms
5,376 KB
testcase_07 AC 6 ms
5,376 KB
testcase_08 AC 5 ms
5,376 KB
testcase_09 AC 5 ms
5,376 KB
testcase_10 AC 5 ms
5,376 KB
testcase_11 AC 5 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 AC 6 ms
5,376 KB
testcase_14 AC 8 ms
5,376 KB
testcase_15 AC 8 ms
5,376 KB
testcase_16 AC 7 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 8 ms
5,376 KB
testcase_21 AC 8 ms
5,376 KB
testcase_22 AC 7 ms
5,376 KB
testcase_23 AC 11 ms
5,376 KB
testcase_24 AC 12 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 12 ms
5,376 KB
testcase_34 AC 12 ms
5,376 KB
testcase_35 AC 13 ms
5,376 KB
testcase_36 AC 12 ms
5,376 KB
testcase_37 AC 12 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 9 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
#include <stack>
#include <sstream>
#include <utility>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <array>
#include <bitset>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline ll time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<double> p(n),q(n);
    for(int i=0;i<n;i++){
        int x; cin >> x;
        p[i] = x/1000.0;
    }
    for(int i=0;i<n;i++){
        int x; cin >> x;
        q[i] = x/100.0;
    }
    const int k = 100000;
    vector<double> s(k);
    s[0] = 1;
    double res = 1;
    priority_queue<pair<double,double>> pq;
    for(int i=0;i<n;i++){
        pq.push({p[i]*q[i],q[i]});
    }
    for(int i=1;i<k;i++){
        auto p = pq.top(); pq.pop();
        s[i] = s[i-1] - p.first;
        res += s[i];
        p.first *= (1-p.second);
        pq.push(p);
    }
    printf("%.9f\n",res);
}

0