結果
問題 | No.210 探し物はどこですか? |
ユーザー | 37zigen |
提出日時 | 2016-03-23 14:59:38 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,050 bytes |
コンパイル時間 | 1,884 ms |
コンパイル使用メモリ | 78,372 KB |
実行使用メモリ | 63,256 KB |
最終ジャッジ日時 | 2024-04-09 21:02:22 |
合計ジャッジ時間 | 13,770 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 146 ms
54,448 KB |
testcase_04 | AC | 156 ms
54,816 KB |
testcase_05 | AC | 156 ms
55,544 KB |
testcase_06 | AC | 160 ms
54,476 KB |
testcase_07 | AC | 152 ms
54,216 KB |
testcase_08 | AC | 149 ms
54,160 KB |
testcase_09 | AC | 149 ms
54,068 KB |
testcase_10 | AC | 155 ms
54,640 KB |
testcase_11 | AC | 154 ms
54,416 KB |
testcase_12 | AC | 162 ms
54,656 KB |
testcase_13 | AC | 198 ms
54,920 KB |
testcase_14 | AC | 216 ms
54,884 KB |
testcase_15 | AC | 210 ms
55,032 KB |
testcase_16 | AC | 211 ms
54,640 KB |
testcase_17 | AC | 204 ms
55,928 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 267 ms
59,320 KB |
testcase_24 | AC | 267 ms
59,388 KB |
testcase_25 | AC | 271 ms
59,732 KB |
testcase_26 | AC | 276 ms
59,352 KB |
testcase_27 | AC | 260 ms
59,588 KB |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | AC | 303 ms
60,456 KB |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | AC | 122 ms
54,348 KB |
testcase_44 | AC | 154 ms
54,388 KB |
testcase_45 | AC | 158 ms
54,484 KB |
ソースコード
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<30000;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); } }