結果

問題 No.210 探し物はどこですか?
ユーザー nebukuro09nebukuro09
提出日時 2017-06-02 13:43:28
言語 D
(dmd 2.106.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 718 bytes
コンパイル時間 2,332 ms
コンパイル使用メモリ 179,336 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-03 13:51:30
合計ジャッジ時間 28,541 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 321 ms
4,380 KB
testcase_01 AC 397 ms
4,376 KB
testcase_02 AC 430 ms
4,380 KB
testcase_03 AC 1,456 ms
4,376 KB
testcase_04 AC 246 ms
4,380 KB
testcase_05 AC 279 ms
4,376 KB
testcase_06 TLE -
testcase_07 AC 269 ms
4,376 KB
testcase_08 AC 215 ms
4,376 KB
testcase_09 AC 217 ms
4,376 KB
testcase_10 AC 219 ms
4,376 KB
testcase_11 AC 215 ms
4,376 KB
testcase_12 AC 218 ms
4,380 KB
testcase_13 AC 454 ms
4,380 KB
testcase_14 AC 422 ms
4,376 KB
testcase_15 AC 422 ms
4,380 KB
testcase_16 AC 449 ms
4,376 KB
testcase_17 AC 415 ms
4,376 KB
testcase_18 AC 373 ms
4,380 KB
testcase_19 AC 376 ms
4,376 KB
testcase_20 AC 378 ms
4,380 KB
testcase_21 AC 379 ms
4,376 KB
testcase_22 AC 380 ms
4,376 KB
testcase_23 AC 570 ms
4,380 KB
testcase_24 AC 555 ms
4,380 KB
testcase_25 AC 555 ms
4,376 KB
testcase_26 AC 564 ms
4,376 KB
testcase_27 AC 573 ms
4,380 KB
testcase_28 AC 479 ms
4,376 KB
testcase_29 AC 481 ms
4,376 KB
testcase_30 AC 480 ms
4,380 KB
testcase_31 AC 480 ms
4,380 KB
testcase_32 AC 479 ms
4,376 KB
testcase_33 AC 634 ms
4,380 KB
testcase_34 AC 634 ms
4,376 KB
testcase_35 AC 628 ms
4,380 KB
testcase_36 AC 640 ms
4,376 KB
testcase_37 AC 638 ms
4,376 KB
testcase_38 AC 524 ms
4,376 KB
testcase_39 AC 525 ms
4,376 KB
testcase_40 AC 522 ms
4,376 KB
testcase_41 AC 525 ms
4,376 KB
testcase_42 AC 525 ms
4,380 KB
testcase_43 AC 72 ms
4,376 KB
testcase_44 AC 258 ms
4,376 KB
testcase_45 AC 1,954 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;


void main() {
    auto N = readln.chomp.to!int;
    auto P = readln.split.map!(x => x.to!real / 1000).array;
    auto Q = readln.split.map!(x => x.to!real / 100).array;

    auto pq = new BinaryHeap!(Array!(Tuple!(real, int)), "a < b");
    foreach (i; 0..N) pq.insert(tuple(P[i] * Q[i], i));

    real ans = 0;
    
    const int TRY = 10^^6;
    foreach (i; 1..TRY+1) {
        auto t = pq.front;
        ans += i * t[0];
        pq.replaceFront(tuple(t[0] * (1 - Q[t[1]]), t[1]));
    }

    writefln("%.9f", ans);
}
0