結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2022-05-08 13:44:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,607 ms / 2,000 ms
コード長 686 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 84,080 KB
最終ジャッジ日時 2023-09-22 09:28:00
合計ジャッジ時間 59,499 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,063 ms
77,780 KB
testcase_01 AC 1,332 ms
80,668 KB
testcase_02 AC 1,454 ms
83,796 KB
testcase_03 AC 1,068 ms
77,876 KB
testcase_04 AC 966 ms
77,480 KB
testcase_05 AC 904 ms
77,468 KB
testcase_06 AC 974 ms
77,900 KB
testcase_07 AC 948 ms
77,828 KB
testcase_08 AC 865 ms
77,816 KB
testcase_09 AC 874 ms
77,892 KB
testcase_10 AC 861 ms
77,928 KB
testcase_11 AC 936 ms
78,124 KB
testcase_12 AC 911 ms
77,880 KB
testcase_13 AC 1,207 ms
78,092 KB
testcase_14 AC 1,369 ms
78,044 KB
testcase_15 AC 1,357 ms
77,836 KB
testcase_16 AC 1,347 ms
78,240 KB
testcase_17 AC 1,455 ms
77,940 KB
testcase_18 AC 984 ms
78,028 KB
testcase_19 AC 979 ms
78,392 KB
testcase_20 AC 991 ms
78,208 KB
testcase_21 AC 981 ms
77,996 KB
testcase_22 AC 999 ms
78,200 KB
testcase_23 AC 1,406 ms
80,420 KB
testcase_24 AC 1,390 ms
80,276 KB
testcase_25 AC 1,379 ms
80,612 KB
testcase_26 AC 1,446 ms
80,928 KB
testcase_27 AC 1,452 ms
80,768 KB
testcase_28 AC 1,343 ms
80,920 KB
testcase_29 AC 1,354 ms
80,048 KB
testcase_30 AC 1,351 ms
80,808 KB
testcase_31 AC 1,348 ms
80,104 KB
testcase_32 AC 1,348 ms
80,292 KB
testcase_33 AC 1,584 ms
83,760 KB
testcase_34 AC 1,598 ms
83,964 KB
testcase_35 AC 1,592 ms
83,128 KB
testcase_36 AC 1,607 ms
84,080 KB
testcase_37 AC 1,567 ms
83,768 KB
testcase_38 AC 1,527 ms
83,468 KB
testcase_39 AC 1,520 ms
83,316 KB
testcase_40 AC 1,536 ms
83,564 KB
testcase_41 AC 1,517 ms
83,460 KB
testcase_42 AC 1,513 ms
83,476 KB
testcase_43 AC 105 ms
76,852 KB
testcase_44 AC 985 ms
77,056 KB
testcase_45 AC 1,019 ms
77,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
import sys
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
readline=sys.stdin.readline

N=int(readline())
P=list(map(int,readline().split()))
Q=list(map(int,readline().split()))
for i in range(N):
    P[i]=[P[i]*Q[i]/100000,i]
    Q[i]/=100
_heapify_max(P)
ans=0
pro=1
for _ in range(10**6):
    p,i=_heappop_max(P)
    ans+=pro
    pro-=p
    _heappush_max(P,[p*(1-Q[i]),i])
print(ans)
0