結果

問題 No.210 探し物はどこですか?
ユーザー 唐澤貴洋唐澤貴洋
提出日時 2015-10-15 22:58:43
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,145 bytes
コンパイル時間 2,670 ms
コンパイル使用メモリ 73,408 KB
実行使用メモリ 8,384 KB
最終ジャッジ日時 2023-09-28 21:52:33
合計ジャッジ時間 12,842 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
8,216 KB
testcase_01 AC 361 ms
8,276 KB
testcase_02 WA -
testcase_03 AC 11 ms
8,276 KB
testcase_04 AC 11 ms
8,236 KB
testcase_05 AC 11 ms
8,216 KB
testcase_06 AC 11 ms
8,348 KB
testcase_07 AC 12 ms
8,328 KB
testcase_08 AC 31 ms
8,176 KB
testcase_09 AC 34 ms
8,220 KB
testcase_10 AC 35 ms
8,184 KB
testcase_11 AC 45 ms
8,176 KB
testcase_12 AC 46 ms
8,208 KB
testcase_13 AC 40 ms
8,272 KB
testcase_14 AC 36 ms
8,288 KB
testcase_15 AC 78 ms
8,280 KB
testcase_16 AC 34 ms
8,236 KB
testcase_17 AC 88 ms
8,212 KB
testcase_18 AC 110 ms
8,208 KB
testcase_19 AC 109 ms
8,176 KB
testcase_20 AC 110 ms
8,360 KB
testcase_21 AC 109 ms
8,352 KB
testcase_22 AC 110 ms
8,180 KB
testcase_23 AC 175 ms
8,328 KB
testcase_24 AC 210 ms
8,276 KB
testcase_25 AC 215 ms
8,228 KB
testcase_26 AC 195 ms
8,276 KB
testcase_27 AC 175 ms
8,184 KB
testcase_28 AC 440 ms
8,360 KB
testcase_29 AC 444 ms
8,248 KB
testcase_30 AC 442 ms
8,272 KB
testcase_31 AC 435 ms
8,344 KB
testcase_32 AC 447 ms
8,192 KB
testcase_33 AC 314 ms
8,348 KB
testcase_34 AC 307 ms
8,384 KB
testcase_35 AC 329 ms
8,208 KB
testcase_36 AC 289 ms
8,232 KB
testcase_37 AC 299 ms
8,272 KB
testcase_38 AC 706 ms
8,196 KB
testcase_39 AC 688 ms
8,348 KB
testcase_40 AC 714 ms
8,316 KB
testcase_41 AC 686 ms
8,280 KB
testcase_42 AC 685 ms
8,292 KB
testcase_43 AC 11 ms
8,180 KB
testcase_44 AC 11 ms
8,280 KB
testcase_45 AC 11 ms
8,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<list>
#include<stack>
#include<queue>
#include<bitset>
#include<array>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstdlib>
#include<numeric>
#define D long long
#define U unsigned
#define SHIKOU 600000
using namespace std;
D n, m,a, b, d, e, x, y, z;
D i, j, k;
char c,f;
string s;
struct Prob {
	double p;
	double q;
	double r;
	bool operator<(const Prob &obj)const {
		return r < obj.r;
	}
	bool operator>(const Prob &obj)const {
		return r > obj.r;
	}
};
Prob p[1000];
double kitai[SHIKOU];
double ans;
int main() {
	D t;
	cin >> a;
	for (i = 0; i < a; i++) {
		cin >> p[i].p;
		p[i].p /= 1000.0;
	}
	for (i = 0; i < a; i++) {
		cin >> p[i].q;
		p[i].q /= 100.0;
	}
	for (i = 0; i < a; i++)
		p[i].r = p[i].p * p[i].q;
	sort(p, p + a);
	reverse(p, p + a);
	for (i = 0; i < SHIKOU; i++) {
		kitai[i] +=p[0].r;
		p[0].p *= 1.0 - p[0].q;
		p[0].r = p[0].p*p[0].q;
		for (j = 1; j < a; j++) {
			if (p[j - 1]<p[j])
				swap(p[j - 1], p[j]);
			else
				break;
		}
	}
	for (i = 0; i < SHIKOU; i++)
		ans += (double)i*kitai[i];
	printf("%.6f\n", ans+1);
}
0