結果

問題 No.210 探し物はどこですか?
ユーザー y_mazuny_mazun
提出日時 2015-05-15 23:17:06
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 816 ms / 2,000 ms
コード長 662 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 51,000 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-20 08:31:16
合計ジャッジ時間 29,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 174 ms
4,376 KB
testcase_01 AC 311 ms
4,376 KB
testcase_02 AC 371 ms
4,376 KB
testcase_03 AC 668 ms
4,376 KB
testcase_04 AC 673 ms
4,380 KB
testcase_05 AC 661 ms
4,380 KB
testcase_06 AC 663 ms
4,376 KB
testcase_07 AC 658 ms
4,376 KB
testcase_08 AC 616 ms
4,380 KB
testcase_09 AC 620 ms
4,380 KB
testcase_10 AC 621 ms
4,376 KB
testcase_11 AC 667 ms
4,376 KB
testcase_12 AC 666 ms
4,376 KB
testcase_13 AC 673 ms
4,376 KB
testcase_14 AC 741 ms
4,380 KB
testcase_15 AC 761 ms
4,384 KB
testcase_16 AC 719 ms
4,380 KB
testcase_17 AC 747 ms
4,376 KB
testcase_18 AC 416 ms
4,380 KB
testcase_19 AC 418 ms
4,380 KB
testcase_20 AC 439 ms
4,376 KB
testcase_21 AC 426 ms
4,380 KB
testcase_22 AC 430 ms
4,376 KB
testcase_23 AC 790 ms
4,380 KB
testcase_24 AC 804 ms
4,376 KB
testcase_25 AC 816 ms
4,376 KB
testcase_26 AC 752 ms
4,376 KB
testcase_27 AC 735 ms
4,380 KB
testcase_28 AC 502 ms
4,376 KB
testcase_29 AC 508 ms
4,376 KB
testcase_30 AC 499 ms
4,380 KB
testcase_31 AC 496 ms
4,380 KB
testcase_32 AC 502 ms
4,376 KB
testcase_33 AC 755 ms
4,376 KB
testcase_34 AC 747 ms
4,376 KB
testcase_35 AC 784 ms
4,376 KB
testcase_36 AC 746 ms
4,376 KB
testcase_37 AC 768 ms
4,380 KB
testcase_38 AC 536 ms
4,376 KB
testcase_39 AC 529 ms
4,376 KB
testcase_40 AC 525 ms
4,376 KB
testcase_41 AC 540 ms
4,380 KB
testcase_42 AC 532 ms
4,376 KB
testcase_43 AC 39 ms
4,376 KB
testcase_44 AC 110 ms
4,380 KB
testcase_45 AC 701 ms
4,376 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,5000000){
    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