結果

問題 No.210 探し物はどこですか?
ユーザー 沙耶花沙耶花
提出日時 2021-11-04 20:35:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 735 bytes
コンパイル時間 5,112 ms
コンパイル使用メモリ 254,772 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 03:18:28
合計ジャッジ時間 8,527 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 4 ms
6,944 KB
testcase_04 AC 3 ms
6,940 KB
testcase_05 AC 3 ms
6,940 KB
testcase_06 AC 4 ms
6,940 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 3 ms
6,944 KB
testcase_09 AC 3 ms
6,944 KB
testcase_10 AC 3 ms
6,944 KB
testcase_11 AC 3 ms
6,944 KB
testcase_12 AC 3 ms
6,940 KB
testcase_13 AC 15 ms
6,944 KB
testcase_14 AC 16 ms
6,944 KB
testcase_15 AC 16 ms
6,940 KB
testcase_16 AC 15 ms
6,940 KB
testcase_17 AC 16 ms
6,944 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 68 ms
6,940 KB
testcase_24 AC 69 ms
6,940 KB
testcase_25 AC 68 ms
6,940 KB
testcase_26 AC 67 ms
6,940 KB
testcase_27 AC 68 ms
6,940 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 134 ms
6,940 KB
testcase_34 AC 137 ms
6,944 KB
testcase_35 AC 134 ms
6,940 KB
testcase_36 AC 133 ms
6,948 KB
testcase_37 AC 133 ms
6,940 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 2 ms
6,944 KB
testcase_44 AC 2 ms
6,940 KB
testcase_45 AC 5 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000000000
	
int main(){	
	
	int n;
	cin>>n;
	
	vector<double> p(n),q(n);
	rep(i,n){
		cin>>p[i];
		p[i] /= 1000.0;
	}
	rep(i,n){
		cin>>q[i];
		q[i] /= 100.0;
	}
	
	
	
	
	double ans = 0.0;
	double pp = 1.0;
	
	rep(_,30000){
		ans += pp;
		int ind = 0;
		rep(i,n){
			if(p[i]*q[i]>p[ind]*q[ind])ind = i;
		}
		
		pp *= 1.0 - p[ind]*q[ind];
		p[ind] *= 1.0-q[ind];
		double ps = 0.0;
		rep(i,n)ps += p[i];
		if(ps<1e-10)break;
		rep(i,n){
			p[i] = p[i] / ps;
		}
	}
	
	cout<<fixed<<setprecision(10)<<ans<<endl;

	return 0;
	
}
0