結果

問題 No.210 探し物はどこですか?
ユーザー ぴろずぴろず
提出日時 2015-05-18 11:09:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 869 ms / 2,000 ms
コード長 727 bytes
コンパイル時間 2,133 ms
コンパイル使用メモリ 76,352 KB
実行使用メモリ 106,676 KB
最終ジャッジ日時 2023-09-20 09:48:58
合計ジャッジ時間 23,578 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
63,240 KB
testcase_01 AC 463 ms
80,336 KB
testcase_02 AC 638 ms
105,576 KB
testcase_03 AC 137 ms
55,904 KB
testcase_04 AC 139 ms
55,876 KB
testcase_05 AC 139 ms
56,096 KB
testcase_06 AC 138 ms
55,896 KB
testcase_07 AC 140 ms
55,984 KB
testcase_08 AC 138 ms
55,752 KB
testcase_09 AC 139 ms
55,776 KB
testcase_10 AC 138 ms
55,596 KB
testcase_11 AC 139 ms
56,288 KB
testcase_12 AC 137 ms
55,656 KB
testcase_13 AC 258 ms
63,228 KB
testcase_14 AC 254 ms
63,320 KB
testcase_15 AC 264 ms
63,324 KB
testcase_16 AC 260 ms
63,104 KB
testcase_17 AC 258 ms
63,332 KB
testcase_18 AC 272 ms
63,228 KB
testcase_19 AC 278 ms
62,772 KB
testcase_20 AC 280 ms
63,328 KB
testcase_21 AC 274 ms
62,776 KB
testcase_22 AC 278 ms
62,208 KB
testcase_23 AC 568 ms
82,588 KB
testcase_24 AC 520 ms
75,184 KB
testcase_25 AC 576 ms
80,920 KB
testcase_26 AC 536 ms
75,248 KB
testcase_27 AC 591 ms
81,068 KB
testcase_28 AC 593 ms
81,160 KB
testcase_29 AC 529 ms
81,016 KB
testcase_30 AC 542 ms
80,596 KB
testcase_31 AC 548 ms
81,048 KB
testcase_32 AC 558 ms
82,116 KB
testcase_33 AC 845 ms
93,940 KB
testcase_34 AC 808 ms
93,512 KB
testcase_35 AC 721 ms
93,256 KB
testcase_36 AC 799 ms
93,336 KB
testcase_37 AC 869 ms
94,472 KB
testcase_38 AC 695 ms
106,320 KB
testcase_39 AC 706 ms
106,572 KB
testcase_40 AC 789 ms
106,676 KB
testcase_41 AC 785 ms
104,576 KB
testcase_42 AC 788 ms
106,460 KB
testcase_43 AC 129 ms
55,932 KB
testcase_44 AC 141 ms
56,100 KB
testcase_45 AC 142 ms
56,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no210;

import java.util.ArrayList;
import java.util.Collections;
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];
		double[] q = new double[n];
		for(int i=0;i<n;i++) {
			p[i] = sc.nextInt() / 1000D;
		}
		for(int i=0;i<n;i++) {
			q[i] = sc.nextInt() / 100D;
		}
		ArrayList<Double> al = new ArrayList<>();
		for(int i=0;i<n;i++) {
			for(int k=1;k<=1000;k++) {
				al.add(p[i] * Math.pow(1-q[i], k-1) * q[i]);
			}
		}
		Collections.sort(al,Collections.reverseOrder());
		double e = 0;
		for(int i=0;i<al.size();i++) {
			e += (i+1) * al.get(i);
		}
		System.out.println(e);
	}

}
0