結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2022-05-08 13:45:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 687 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 81,364 KB
最終ジャッジ日時 2023-09-22 09:29:28
合計ジャッジ時間 32,451 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 579 ms
77,732 KB
testcase_01 AC 701 ms
79,124 KB
testcase_02 WA -
testcase_03 AC 550 ms
77,792 KB
testcase_04 AC 485 ms
77,652 KB
testcase_05 AC 478 ms
77,624 KB
testcase_06 AC 602 ms
77,996 KB
testcase_07 AC 521 ms
77,804 KB
testcase_08 AC 377 ms
77,484 KB
testcase_09 AC 383 ms
78,092 KB
testcase_10 AC 389 ms
78,004 KB
testcase_11 AC 435 ms
78,120 KB
testcase_12 AC 439 ms
77,812 KB
testcase_13 AC 589 ms
78,196 KB
testcase_14 AC 676 ms
78,012 KB
testcase_15 AC 669 ms
77,848 KB
testcase_16 AC 646 ms
78,296 KB
testcase_17 AC 697 ms
77,912 KB
testcase_18 AC 538 ms
78,028 KB
testcase_19 AC 544 ms
78,360 KB
testcase_20 AC 540 ms
78,404 KB
testcase_21 AC 543 ms
78,032 KB
testcase_22 AC 539 ms
77,860 KB
testcase_23 AC 741 ms
79,112 KB
testcase_24 AC 735 ms
79,112 KB
testcase_25 AC 733 ms
79,408 KB
testcase_26 AC 738 ms
79,328 KB
testcase_27 AC 744 ms
79,240 KB
testcase_28 AC 715 ms
79,896 KB
testcase_29 AC 733 ms
78,776 KB
testcase_30 AC 716 ms
79,780 KB
testcase_31 AC 711 ms
78,644 KB
testcase_32 AC 721 ms
78,888 KB
testcase_33 AC 849 ms
81,236 KB
testcase_34 AC 845 ms
81,364 KB
testcase_35 AC 842 ms
80,576 KB
testcase_36 AC 830 ms
81,184 KB
testcase_37 AC 826 ms
81,300 KB
testcase_38 AC 849 ms
81,128 KB
testcase_39 AC 828 ms
81,140 KB
testcase_40 AC 813 ms
81,044 KB
testcase_41 AC 814 ms
80,904 KB
testcase_42 AC 809 ms
81,052 KB
testcase_43 AC 92 ms
76,648 KB
testcase_44 AC 506 ms
77,500 KB
testcase_45 AC 532 ms
77,980 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