結果

問題 No.210 探し物はどこですか?
ユーザー nebukuro09nebukuro09
提出日時 2017-06-02 13:41:00
言語 D
(dmd 2.107.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 732 bytes
コンパイル時間 3,183 ms
コンパイル使用メモリ 179,324 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-03 13:50:47
合計ジャッジ時間 40,010 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 546 ms
4,376 KB
testcase_01 AC 623 ms
4,376 KB
testcase_02 AC 654 ms
4,376 KB
testcase_03 AC 1,767 ms
4,380 KB
testcase_04 AC 437 ms
4,376 KB
testcase_05 AC 479 ms
4,376 KB
testcase_06 TLE -
testcase_07 AC 455 ms
4,380 KB
testcase_08 AC 428 ms
4,380 KB
testcase_09 AC 431 ms
4,376 KB
testcase_10 AC 431 ms
4,376 KB
testcase_11 AC 440 ms
4,376 KB
testcase_12 AC 442 ms
4,376 KB
testcase_13 AC 622 ms
4,376 KB
testcase_14 AC 637 ms
4,376 KB
testcase_15 AC 643 ms
4,376 KB
testcase_16 AC 644 ms
4,376 KB
testcase_17 AC 640 ms
4,380 KB
testcase_18 AC 599 ms
4,380 KB
testcase_19 AC 602 ms
4,380 KB
testcase_20 AC 603 ms
4,376 KB
testcase_21 AC 603 ms
4,376 KB
testcase_22 AC 603 ms
4,380 KB
testcase_23 AC 780 ms
4,380 KB
testcase_24 AC 778 ms
4,376 KB
testcase_25 AC 780 ms
4,380 KB
testcase_26 AC 786 ms
4,376 KB
testcase_27 AC 791 ms
4,380 KB
testcase_28 AC 718 ms
4,376 KB
testcase_29 AC 720 ms
4,380 KB
testcase_30 AC 716 ms
4,376 KB
testcase_31 AC 714 ms
4,380 KB
testcase_32 AC 714 ms
4,376 KB
testcase_33 AC 858 ms
4,376 KB
testcase_34 AC 858 ms
4,376 KB
testcase_35 AC 863 ms
4,376 KB
testcase_36 AC 865 ms
4,376 KB
testcase_37 AC 862 ms
4,380 KB
testcase_38 AC 753 ms
4,380 KB
testcase_39 AC 754 ms
4,380 KB
testcase_40 AC 750 ms
4,376 KB
testcase_41 AC 756 ms
4,376 KB
testcase_42 AC 752 ms
4,376 KB
testcase_43 AC 77 ms
4,376 KB
testcase_44 AC 421 ms
4,376 KB
testcase_45 TLE -
権限があれば一括ダウンロードができます

ソースコード

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;
        pq.popFront;
        ans += i * t[0];
        pq.insert(tuple(t[0] * (1 - Q[t[1]]), t[1]));
    }

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