結果

問題 No.210 探し物はどこですか?
ユーザー motimoti
提出日時 2015-07-29 11:11:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 225 ms / 2,000 ms
コード長 781 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 94,612 KB
実行使用メモリ 13,816 KB
最終ジャッジ日時 2023-09-24 21:30:40
合計ジャッジ時間 6,693 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
4,536 KB
testcase_01 AC 83 ms
7,928 KB
testcase_02 AC 164 ms
12,060 KB
testcase_03 AC 4 ms
4,376 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 3 ms
4,376 KB
testcase_08 AC 3 ms
4,376 KB
testcase_09 AC 4 ms
4,380 KB
testcase_10 AC 3 ms
4,384 KB
testcase_11 AC 4 ms
4,380 KB
testcase_12 AC 4 ms
4,380 KB
testcase_13 AC 21 ms
4,724 KB
testcase_14 AC 20 ms
4,560 KB
testcase_15 AC 21 ms
4,720 KB
testcase_16 AC 21 ms
4,720 KB
testcase_17 AC 21 ms
4,632 KB
testcase_18 AC 22 ms
4,596 KB
testcase_19 AC 22 ms
4,760 KB
testcase_20 AC 22 ms
4,708 KB
testcase_21 AC 22 ms
4,740 KB
testcase_22 AC 22 ms
4,540 KB
testcase_23 AC 110 ms
8,912 KB
testcase_24 AC 109 ms
8,652 KB
testcase_25 AC 108 ms
8,476 KB
testcase_26 AC 108 ms
8,740 KB
testcase_27 AC 110 ms
8,124 KB
testcase_28 AC 102 ms
8,608 KB
testcase_29 AC 104 ms
8,988 KB
testcase_30 AC 102 ms
8,284 KB
testcase_31 AC 101 ms
8,548 KB
testcase_32 AC 103 ms
8,892 KB
testcase_33 AC 222 ms
13,516 KB
testcase_34 AC 220 ms
13,016 KB
testcase_35 AC 225 ms
12,628 KB
testcase_36 AC 224 ms
12,172 KB
testcase_37 AC 215 ms
13,152 KB
testcase_38 AC 191 ms
11,836 KB
testcase_39 AC 192 ms
12,836 KB
testcase_40 AC 197 ms
13,816 KB
testcase_41 AC 198 ms
12,120 KB
testcase_42 AC 191 ms
12,000 KB
testcase_43 AC 2 ms
4,376 KB
testcase_44 AC 2 ms
4,376 KB
testcase_45 AC 4 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

int main() {

  int N; cin >> N;
  double p[N], q[N];
  rep(i, N) cin >> p[i], p[i] /= 1000;
  rep(i, N) cin >> q[i], q[i] /= 100;

  priority_queue<double> pq;
  rep(k, 1000) {
    rep(i, N) {
      pq.emplace(p[i] * pow(1-q[i], k) * q[i]);
    }
  }

  double res = 0.0;
  int cnt = 1;
  while(!pq.empty()) {
    res += (cnt++) * pq.top(); pq.pop();
  }

  cout << setprecision(6) << res << endl;

  return 0;
}
0