結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2022-05-08 13:46:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,284 ms / 2,000 ms
コード長 688 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 82,976 KB
最終ジャッジ日時 2023-09-22 09:30:35
合計ジャッジ時間 47,729 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 845 ms
77,816 KB
testcase_01 AC 1,056 ms
80,292 KB
testcase_02 AC 1,178 ms
82,956 KB
testcase_03 AC 813 ms
77,664 KB
testcase_04 AC 736 ms
77,956 KB
testcase_05 AC 703 ms
77,688 KB
testcase_06 AC 758 ms
78,056 KB
testcase_07 AC 697 ms
77,948 KB
testcase_08 AC 637 ms
78,072 KB
testcase_09 AC 621 ms
78,132 KB
testcase_10 AC 649 ms
78,200 KB
testcase_11 AC 703 ms
78,084 KB
testcase_12 AC 677 ms
78,012 KB
testcase_13 AC 931 ms
78,028 KB
testcase_14 AC 1,091 ms
77,964 KB
testcase_15 AC 1,090 ms
77,964 KB
testcase_16 AC 1,030 ms
78,208 KB
testcase_17 AC 1,121 ms
77,940 KB
testcase_18 AC 791 ms
77,832 KB
testcase_19 AC 806 ms
78,236 KB
testcase_20 AC 810 ms
78,196 KB
testcase_21 AC 804 ms
78,192 KB
testcase_22 AC 798 ms
78,060 KB
testcase_23 AC 1,128 ms
79,960 KB
testcase_24 AC 1,126 ms
79,908 KB
testcase_25 AC 1,129 ms
80,072 KB
testcase_26 AC 1,126 ms
80,060 KB
testcase_27 AC 1,141 ms
80,132 KB
testcase_28 AC 1,081 ms
80,392 KB
testcase_29 AC 1,083 ms
79,560 KB
testcase_30 AC 1,086 ms
80,372 KB
testcase_31 AC 1,088 ms
79,552 KB
testcase_32 AC 1,102 ms
79,512 KB
testcase_33 AC 1,276 ms
82,820 KB
testcase_34 AC 1,270 ms
82,812 KB
testcase_35 AC 1,265 ms
81,912 KB
testcase_36 AC 1,267 ms
82,976 KB
testcase_37 AC 1,284 ms
82,864 KB
testcase_38 AC 1,224 ms
82,496 KB
testcase_39 AC 1,222 ms
82,292 KB
testcase_40 AC 1,224 ms
82,576 KB
testcase_41 AC 1,239 ms
82,456 KB
testcase_42 AC 1,239 ms
82,724 KB
testcase_43 AC 99 ms
76,736 KB
testcase_44 AC 758 ms
77,064 KB
testcase_45 AC 790 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(8*10**5):
    p,i=_heappop_max(P)
    ans+=pro
    pro-=p
    _heappush_max(P,[p*(1-Q[i]),i])
print(ans)
0