結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 201 ms
6,812 KB
testcase_01 AC 1,036 ms
6,940 KB
testcase_02 TLE -
testcase_03 AC 45 ms
6,944 KB
testcase_04 AC 43 ms
6,940 KB
testcase_05 AC 41 ms
6,944 KB
testcase_06 AC 45 ms
6,940 KB
testcase_07 AC 42 ms
6,940 KB
testcase_08 AC 23 ms
6,940 KB
testcase_09 AC 23 ms
6,944 KB
testcase_10 AC 23 ms
6,944 KB
testcase_11 AC 29 ms
6,940 KB
testcase_12 AC 30 ms
6,940 KB
testcase_13 AC 201 ms
6,940 KB
testcase_14 AC 209 ms
6,944 KB
testcase_15 AC 207 ms
6,940 KB
testcase_16 AC 208 ms
6,940 KB
testcase_17 AC 213 ms
6,940 KB
testcase_18 AC 201 ms
6,940 KB
testcase_19 AC 201 ms
6,944 KB
testcase_20 AC 202 ms
6,944 KB
testcase_21 AC 201 ms
6,940 KB
testcase_22 AC 201 ms
6,944 KB
testcase_23 AC 1,030 ms
6,944 KB
testcase_24 AC 1,032 ms
6,944 KB
testcase_25 AC 1,032 ms
6,944 KB
testcase_26 AC 1,032 ms
6,944 KB
testcase_27 AC 1,036 ms
6,940 KB
testcase_28 AC 1,037 ms
6,944 KB
testcase_29 AC 1,036 ms
6,940 KB
testcase_30 AC 1,033 ms
6,944 KB
testcase_31 AC 1,030 ms
6,944 KB
testcase_32 AC 1,028 ms
6,944 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 AC 8 ms
6,940 KB
testcase_44 AC 2 ms
6,944 KB
testcase_45 AC 46 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(_,460000){
		ans += pp;
		int ind = 0;
		double t = p[ind]*q[ind];
		for(int i=1;i<n;i++){
			if(p[i]*q[i]>t){
				ind = i;
				t = p[i]*q[i];
			}
		}
		
		pp *= 1.0 - t;
		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