結果

問題 No.210 探し物はどこですか?
ユーザー y_mazuny_mazun
提出日時 2015-05-15 23:16:33
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 451 ms
コンパイル使用メモリ 50,916 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-20 08:30:41
合計ジャッジ時間 4,313 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
4,384 KB
testcase_01 AC 33 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 67 ms
4,376 KB
testcase_04 AC 62 ms
4,376 KB
testcase_05 AC 60 ms
4,380 KB
testcase_06 AC 66 ms
4,376 KB
testcase_07 AC 61 ms
4,380 KB
testcase_08 AC 20 ms
4,380 KB
testcase_09 AC 23 ms
4,376 KB
testcase_10 AC 25 ms
4,376 KB
testcase_11 AC 36 ms
4,380 KB
testcase_12 AC 38 ms
4,380 KB
testcase_13 AC 29 ms
4,376 KB
testcase_14 AC 53 ms
4,376 KB
testcase_15 AC 53 ms
4,380 KB
testcase_16 AC 49 ms
4,376 KB
testcase_17 AC 59 ms
4,376 KB
testcase_18 AC 35 ms
4,380 KB
testcase_19 AC 36 ms
4,380 KB
testcase_20 AC 36 ms
4,380 KB
testcase_21 AC 37 ms
4,380 KB
testcase_22 AC 36 ms
4,384 KB
testcase_23 AC 50 ms
4,380 KB
testcase_24 AC 51 ms
4,376 KB
testcase_25 AC 52 ms
4,380 KB
testcase_26 AC 52 ms
4,376 KB
testcase_27 AC 52 ms
4,380 KB
testcase_28 AC 52 ms
4,384 KB
testcase_29 AC 53 ms
4,376 KB
testcase_30 AC 52 ms
4,376 KB
testcase_31 AC 52 ms
4,376 KB
testcase_32 AC 52 ms
4,376 KB
testcase_33 AC 61 ms
4,380 KB
testcase_34 AC 61 ms
4,380 KB
testcase_35 AC 63 ms
4,376 KB
testcase_36 AC 61 ms
4,376 KB
testcase_37 AC 61 ms
4,376 KB
testcase_38 AC 56 ms
4,380 KB
testcase_39 AC 55 ms
4,380 KB
testcase_40 AC 54 ms
4,380 KB
testcase_41 AC 55 ms
4,380 KB
testcase_42 AC 55 ms
4,376 KB
testcase_43 AC 6 ms
4,376 KB
testcase_44 AC 13 ms
4,376 KB
testcase_45 AC 70 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#include <queue>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <set>

using namespace std;

int main(){
  const int n = getInt();
  vector<int> p(n);
  vector<int> q(n);

  REP(i,n) p[i] = getInt();
  REP(i,n) q[i] = getInt();

  priority_queue<pair<double, double> > pq;

  REP(i,n) pq.push(make_pair(p[i] / 1000.0 * q[i] / 100.0, q[i] / 100.0));

  double ans = 0;
  REP(i,500000){
    const pair<double, double> d = pq.top(); pq.pop();
    ans += (i + 1) * d.first;
    pq.push(make_pair(d.first * (1 - d.second), d.second));
  }

  printf("%.10f\n", ans);
  return 0;
}
0