結果

問題 No.210 探し物はどこですか?
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-09-28 21:22:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 777 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 69,916 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 07:25:24
合計ジャッジ時間 6,235 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
6,812 KB
testcase_01 AC 77 ms
6,940 KB
testcase_02 AC 77 ms
6,940 KB
testcase_03 AC 123 ms
6,944 KB
testcase_04 AC 116 ms
6,940 KB
testcase_05 AC 113 ms
6,944 KB
testcase_06 AC 128 ms
6,944 KB
testcase_07 AC 117 ms
6,940 KB
testcase_08 AC 77 ms
6,944 KB
testcase_09 AC 88 ms
6,944 KB
testcase_10 AC 84 ms
6,944 KB
testcase_11 AC 95 ms
6,940 KB
testcase_12 AC 94 ms
6,940 KB
testcase_13 AC 89 ms
6,944 KB
testcase_14 AC 115 ms
6,940 KB
testcase_15 AC 115 ms
6,940 KB
testcase_16 AC 111 ms
6,944 KB
testcase_17 AC 119 ms
6,940 KB
testcase_18 AC 67 ms
6,940 KB
testcase_19 AC 67 ms
6,944 KB
testcase_20 AC 70 ms
6,944 KB
testcase_21 AC 68 ms
6,944 KB
testcase_22 AC 68 ms
6,944 KB
testcase_23 AC 95 ms
6,940 KB
testcase_24 AC 104 ms
6,940 KB
testcase_25 AC 106 ms
6,944 KB
testcase_26 AC 103 ms
6,940 KB
testcase_27 AC 104 ms
6,940 KB
testcase_28 AC 107 ms
6,944 KB
testcase_29 AC 108 ms
6,940 KB
testcase_30 AC 105 ms
6,944 KB
testcase_31 AC 106 ms
6,944 KB
testcase_32 AC 108 ms
6,940 KB
testcase_33 AC 115 ms
6,944 KB
testcase_34 AC 116 ms
6,940 KB
testcase_35 AC 120 ms
6,944 KB
testcase_36 AC 120 ms
6,944 KB
testcase_37 AC 114 ms
6,944 KB
testcase_38 AC 107 ms
6,940 KB
testcase_39 AC 104 ms
6,940 KB
testcase_40 AC 103 ms
6,944 KB
testcase_41 AC 105 ms
6,940 KB
testcase_42 AC 103 ms
6,940 KB
testcase_43 AC 21 ms
6,944 KB
testcase_44 AC 27 ms
6,944 KB
testcase_45 AC 125 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstdio>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
const int INF = 1e9;

int n;
int p[1010], q[1010];

int main(void){
	cin >> n;
	rep(i, n) cin >> p[i];
	rep(i, n) cin >> q[i];
	priority_queue<pair<double, int> > pq;//fi:確率 se:何番目の部屋
	//i番目の場所で1回目で見つける確率を入れる
	rep(i, n) pq.push(make_pair(p[i] * q[i] / 100000.0, i));
	double E = 0.0;

	for (int i = 1; i <= 1000000; ++i){
		auto u = pq.top(); pq.pop();
		E += i * u.first;//i回目に見つける期待値
		//i回目に見つけられない
		pq.push(make_pair(u.first * (1.0 - q[u.second] / 100.0), u.second));
	}
	printf("%.9f\n", E);
	return 0;
}	
0