結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2021-09-25 01:28:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,805 ms / 2,000 ms
コード長 685 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 8,500 KB
最終ジャッジ日時 2023-09-18 22:42:02
合計ジャッジ時間 43,218 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,376 ms
8,176 KB
testcase_01 AC 1,486 ms
8,276 KB
testcase_02 AC 1,641 ms
8,064 KB
testcase_03 AC 1,426 ms
8,100 KB
testcase_04 AC 1,327 ms
8,008 KB
testcase_05 AC 1,257 ms
8,032 KB
testcase_06 AC 1,347 ms
8,032 KB
testcase_07 AC 1,363 ms
8,076 KB
testcase_08 AC 1,264 ms
8,068 KB
testcase_09 AC 1,233 ms
8,004 KB
testcase_10 AC 1,276 ms
8,008 KB
testcase_11 AC 1,261 ms
8,128 KB
testcase_12 AC 1,275 ms
8,008 KB
testcase_13 AC 1,614 ms
8,076 KB
testcase_14 AC 1,805 ms
8,096 KB
testcase_15 AC 1,679 ms
8,012 KB
testcase_16 AC 1,665 ms
8,072 KB
testcase_17 AC 1,792 ms
8,068 KB
testcase_18 AC 1,240 ms
8,068 KB
testcase_19 AC 1,268 ms
8,008 KB
testcase_20 AC 1,252 ms
8,196 KB
testcase_21 AC 1,210 ms
8,108 KB
testcase_22 AC 1,250 ms
8,144 KB
testcase_23 AC 1,523 ms
8,308 KB
testcase_24 AC 1,556 ms
8,344 KB
testcase_25 AC 1,632 ms
8,408 KB
testcase_26 AC 1,545 ms
8,408 KB
testcase_27 AC 1,595 ms
8,384 KB
testcase_28 AC 1,565 ms
8,468 KB
testcase_29 AC 1,528 ms
8,500 KB
testcase_30 AC 1,522 ms
8,500 KB
testcase_31 AC 1,558 ms
8,312 KB
testcase_32 AC 1,500 ms
8,312 KB
testcase_33 AC 1,700 ms
8,244 KB
testcase_34 AC 1,728 ms
7,996 KB
testcase_35 AC 1,649 ms
8,076 KB
testcase_36 AC 1,638 ms
8,212 KB
testcase_37 AC 1,706 ms
8,216 KB
testcase_38 AC 1,670 ms
8,020 KB
testcase_39 AC 1,684 ms
8,212 KB
testcase_40 AC 1,688 ms
8,172 KB
testcase_41 AC 1,658 ms
8,036 KB
testcase_42 AC 1,600 ms
8,080 KB
testcase_43 AC 826 ms
8,004 KB
testcase_44 AC 1,384 ms
8,168 KB
testcase_45 AC 1,401 ms
8,168 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