結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2021-09-25 01:29:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 687 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 8,452 KB
最終ジャッジ日時 2023-09-18 22:43:35
合計ジャッジ時間 36,416 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 672 ms
8,164 KB
testcase_01 AC 771 ms
8,396 KB
testcase_02 WA -
testcase_03 AC 699 ms
7,996 KB
testcase_04 AC 656 ms
8,012 KB
testcase_05 AC 681 ms
8,060 KB
testcase_06 AC 688 ms
7,960 KB
testcase_07 AC 667 ms
8,076 KB
testcase_08 AC 547 ms
8,052 KB
testcase_09 AC 545 ms
8,060 KB
testcase_10 AC 549 ms
8,044 KB
testcase_11 AC 624 ms
8,044 KB
testcase_12 AC 600 ms
8,192 KB
testcase_13 AC 660 ms
8,172 KB
testcase_14 AC 786 ms
8,168 KB
testcase_15 AC 775 ms
7,964 KB
testcase_16 AC 785 ms
8,096 KB
testcase_17 AC 831 ms
8,056 KB
testcase_18 AC 634 ms
8,048 KB
testcase_19 AC 631 ms
7,992 KB
testcase_20 AC 653 ms
8,168 KB
testcase_21 AC 646 ms
8,104 KB
testcase_22 AC 634 ms
8,156 KB
testcase_23 AC 778 ms
8,300 KB
testcase_24 AC 770 ms
7,968 KB
testcase_25 AC 785 ms
8,452 KB
testcase_26 AC 803 ms
8,116 KB
testcase_27 AC 772 ms
8,208 KB
testcase_28 AC 763 ms
8,052 KB
testcase_29 AC 755 ms
8,248 KB
testcase_30 AC 772 ms
8,396 KB
testcase_31 AC 763 ms
8,396 KB
testcase_32 AC 767 ms
8,248 KB
testcase_33 AC 829 ms
8,052 KB
testcase_34 AC 842 ms
8,132 KB
testcase_35 AC 824 ms
8,172 KB
testcase_36 AC 845 ms
7,972 KB
testcase_37 AC 825 ms
8,052 KB
testcase_38 AC 844 ms
8,044 KB
testcase_39 AC 853 ms
8,044 KB
testcase_40 AC 839 ms
8,048 KB
testcase_41 AC 838 ms
7,988 KB
testcase_42 AC 842 ms
8,104 KB
testcase_43 AC 408 ms
8,040 KB
testcase_44 AC 698 ms
8,188 KB
testcase_45 AC 696 ms
8,112 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(5*10**5):
    p,i=_heappop_max(P)
    ans+=pro
    pro-=p
    _heappush_max(P,[p*(1-Q[i]),i])
print(ans)
0