結果

問題 No.210 探し物はどこですか?
ユーザー 沙耶花沙耶花
提出日時 2021-11-04 20:38:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 737 bytes
コンパイル時間 4,652 ms
コンパイル使用メモリ 255,604 KB
実行使用メモリ 10,400 KB
最終ジャッジ日時 2024-04-23 03:22:24
合計ジャッジ時間 11,926 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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(_,4200000){
		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