結果

問題 No.210 探し物はどこですか?
ユーザー zzblaczzblac
提出日時 2016-02-18 12:03:10
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 669 bytes
コンパイル時間 1,621 ms
コンパイル使用メモリ 62,756 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-23 18:04:31
合計ジャッジ時間 11,877 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
4,368 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 7 ms
4,368 KB
testcase_04 AC 7 ms
4,368 KB
testcase_05 AC 8 ms
4,368 KB
testcase_06 AC 7 ms
4,368 KB
testcase_07 AC 7 ms
4,368 KB
testcase_08 AC 7 ms
4,368 KB
testcase_09 AC 7 ms
4,368 KB
testcase_10 AC 7 ms
4,368 KB
testcase_11 AC 7 ms
4,368 KB
testcase_12 AC 7 ms
4,368 KB
testcase_13 AC 51 ms
4,368 KB
testcase_14 AC 52 ms
4,368 KB
testcase_15 AC 51 ms
4,368 KB
testcase_16 AC 50 ms
4,368 KB
testcase_17 AC 51 ms
4,368 KB
testcase_18 AC 56 ms
4,368 KB
testcase_19 AC 56 ms
4,368 KB
testcase_20 AC 56 ms
4,368 KB
testcase_21 AC 57 ms
4,368 KB
testcase_22 AC 56 ms
4,368 KB
testcase_23 AC 236 ms
4,368 KB
testcase_24 AC 233 ms
4,368 KB
testcase_25 AC 235 ms
4,368 KB
testcase_26 AC 235 ms
4,368 KB
testcase_27 AC 235 ms
4,368 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 460 ms
4,368 KB
testcase_34 AC 465 ms
4,368 KB
testcase_35 AC 460 ms
4,368 KB
testcase_36 AC 478 ms
4,368 KB
testcase_37 AC 460 ms
4,368 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 3 ms
4,368 KB
testcase_44 AC 7 ms
4,368 KB
testcase_45 AC 7 ms
4,368 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |                 scanf("%lf", &p[i]);
      |                 ~~~~~^~~~~~~~~~~~~~
main.cpp:23:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   23 |                 scanf("%lf", &q[i]);
      |                 ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
const int maxn = 2e5;
double p[1005], dp[1005],q[1005];
int n;
double v(int x){
	return p[x] * (1 - dp[x]) * q[x];
}
int main(){
	cin >> n;
	for (int i = 0; i < n; i++){
		scanf("%lf", &p[i]);
		p[i] /= 1e3;
	}
	for (int i = 0; i < n; i++){
		scanf("%lf", &q[i]);
		q[i] /= 1e2;
	}
	double g = 0;
	for (int i = 1; i < maxn; i++){
		int x = 0;
		for (int j = 0; j < n; j++){
			if (v(x) < v(j)) x = j;
		}
		g += i * v(x);
		dp[x] += (1 - dp[x]) * q[x];
	}
	printf("%.7lf\n", g);
	return 0;
}
0