結果

問題 No.210 探し物はどこですか?
ユーザー btkbtk
提出日時 2015-05-15 23:55:47
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 887 bytes
コンパイル時間 719 ms
コンパイル使用メモリ 84,788 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-20 08:55:17
合計ジャッジ時間 15,584 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
4,376 KB
testcase_01 AC 744 ms
4,380 KB
testcase_02 TLE -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 5 ms
4,380 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 3 ms
4,376 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 19 ms
4,376 KB
testcase_19 AC 19 ms
4,376 KB
testcase_20 AC 18 ms
4,376 KB
testcase_21 AC 19 ms
4,380 KB
testcase_22 AC 19 ms
4,380 KB
testcase_23 AC 30 ms
4,376 KB
testcase_24 AC 25 ms
4,380 KB
testcase_25 AC 26 ms
4,380 KB
testcase_26 AC 28 ms
4,376 KB
testcase_27 AC 40 ms
4,376 KB
testcase_28 AC 393 ms
4,380 KB
testcase_29 AC 387 ms
4,376 KB
testcase_30 AC 389 ms
4,376 KB
testcase_31 AC 404 ms
4,380 KB
testcase_32 AC 390 ms
4,376 KB
testcase_33 AC 101 ms
4,384 KB
testcase_34 AC 103 ms
4,380 KB
testcase_35 AC 94 ms
4,380 KB
testcase_36 AC 115 ms
4,380 KB
testcase_37 AC 100 ms
4,380 KB
testcase_38 AC 1,316 ms
4,380 KB
testcase_39 AC 1,326 ms
4,380 KB
testcase_40 AC 1,388 ms
4,380 KB
testcase_41 AC 1,272 ms
4,376 KB
testcase_42 AC 1,337 ms
4,376 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
const double eps = 1e-7;

int main(void){
	int n;
	double p[1000], q[1000];
	double Q[1000];
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> p[i];
		p[i] /= 1000;
	}
	for (int i = 0; i < n; i++){
		cin >> q[i];
		Q[i] = 1;
		q[i] /= 100;
	}
	double E = 0;
	int cnt = 0;
	while (1){
		cnt ++;
		int index = 0;
		double px = 0;
		for (int i = 0; i < n; i++){
			double d = p[i] * q[i] * Q[i];
			if (d > px){
				index = i;
				px = d;
			}

		}
		E += cnt*px;
		Q[index] *= (1 - q[index]);
		if (cnt*px < eps)break;
	}
	printf("%.4f\n", E);

	return(0);
}
0