結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
4,380 KB
testcase_01 AC 653 ms
4,376 KB
testcase_02 TLE -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 4 ms
4,380 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 3 ms
4,376 KB
testcase_18 AC 17 ms
4,376 KB
testcase_19 AC 18 ms
4,380 KB
testcase_20 AC 16 ms
4,376 KB
testcase_21 AC 17 ms
4,376 KB
testcase_22 AC 17 ms
4,380 KB
testcase_23 AC 26 ms
4,376 KB
testcase_24 AC 21 ms
4,376 KB
testcase_25 AC 22 ms
4,380 KB
testcase_26 AC 24 ms
4,376 KB
testcase_27 AC 35 ms
4,380 KB
testcase_28 AC 343 ms
4,380 KB
testcase_29 AC 338 ms
4,380 KB
testcase_30 AC 339 ms
4,376 KB
testcase_31 AC 351 ms
4,384 KB
testcase_32 AC 340 ms
4,380 KB
testcase_33 AC 87 ms
4,376 KB
testcase_34 AC 88 ms
4,380 KB
testcase_35 AC 81 ms
4,376 KB
testcase_36 AC 99 ms
4,380 KB
testcase_37 AC 87 ms
4,384 KB
testcase_38 AC 1,145 ms
4,376 KB
testcase_39 AC 1,152 ms
4,376 KB
testcase_40 AC 1,212 ms
4,380 KB
testcase_41 AC 1,109 ms
4,376 KB
testcase_42 AC 1,163 ms
4,380 KB
testcase_43 AC 1 ms
4,380 KB
testcase_44 AC 1 ms
4,380 KB
testcase_45 AC 1 ms
4,380 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-6;

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