結果

問題 No.210 探し物はどこですか?
ユーザー 37zigen37zigen
提出日時 2016-03-23 15:03:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,051 bytes
コンパイル時間 2,014 ms
コンパイル使用メモリ 78,160 KB
実行使用メモリ 62,400 KB
最終ジャッジ日時 2024-04-09 21:02:47
合計ジャッジ時間 18,757 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 271 ms
56,480 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 263 ms
54,612 KB
testcase_04 AC 271 ms
54,516 KB
testcase_05 AC 255 ms
54,608 KB
testcase_06 AC 246 ms
54,664 KB
testcase_07 AC 250 ms
55,284 KB
testcase_08 AC 201 ms
54,760 KB
testcase_09 AC 213 ms
54,848 KB
testcase_10 AC 211 ms
54,732 KB
testcase_11 AC 211 ms
54,788 KB
testcase_12 AC 211 ms
54,916 KB
testcase_13 AC 267 ms
56,560 KB
testcase_14 AC 289 ms
55,304 KB
testcase_15 AC 283 ms
55,408 KB
testcase_16 AC 263 ms
55,220 KB
testcase_17 AC 300 ms
55,160 KB
testcase_18 AC 288 ms
55,440 KB
testcase_19 AC 277 ms
55,304 KB
testcase_20 AC 281 ms
55,740 KB
testcase_21 AC 308 ms
55,432 KB
testcase_22 AC 278 ms
55,268 KB
testcase_23 AC 386 ms
59,976 KB
testcase_24 AC 395 ms
59,940 KB
testcase_25 AC 390 ms
59,932 KB
testcase_26 AC 391 ms
59,408 KB
testcase_27 AC 387 ms
59,960 KB
testcase_28 AC 377 ms
59,980 KB
testcase_29 AC 398 ms
60,852 KB
testcase_30 AC 416 ms
60,764 KB
testcase_31 AC 388 ms
59,580 KB
testcase_32 AC 423 ms
61,008 KB
testcase_33 AC 422 ms
59,972 KB
testcase_34 AC 458 ms
61,840 KB
testcase_35 AC 454 ms
61,996 KB
testcase_36 AC 413 ms
60,180 KB
testcase_37 AC 449 ms
61,648 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 134 ms
53,652 KB
testcase_44 AC 196 ms
54,772 KB
testcase_45 AC 237 ms
55,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder210;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {

	public static void main(String[] args){

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		double[] p=new double[n+1];
		double[] q=new double[n+1];
		for(int i=0;i<n;i++){
			p[i+1]=sc.nextDouble()/1000;
			//p[i]=i番目の部屋で眼鏡を紛失した確率
		}
		for(int i=0;i<n;i++){
			q[i+1]=sc.nextDouble()/100;
			//q[i]=i番目の部屋に眼鏡が落ちていた場合一回の探索で見つけられる確率
		}

		PriorityQueue<double[]> queue = new PriorityQueue<double[]>(n, new Comparator<double[]>(){
			public int compare(double[] x, double[] y)
			{
				return -Double.compare(x[0], y[0]);
			}
		});

		for(int i=1;i<=n;i++){
			queue.add(new double[]{p[i]*q[i],(double)i});//部屋を探して見つかる確率
		}
		double E=0;
		for(int i=1;i<300000;i++){
			double[] a=queue.poll();
			E+=a[0]*i;
			a[0]=a[0]*(1-q[(int)a[1]]);
			queue.add(a);
		}
		System.out.println(E);

	}
}
0