結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2021-09-25 02:05:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,670 ms / 2,000 ms
コード長 960 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 10,984 KB
実行使用メモリ 10,644 KB
最終ジャッジ日時 2023-09-18 22:45:57
合計ジャッジ時間 66,724 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,244 ms
10,352 KB
testcase_01 AC 1,356 ms
10,520 KB
testcase_02 AC 1,377 ms
10,612 KB
testcase_03 AC 1,277 ms
10,412 KB
testcase_04 AC 1,277 ms
10,528 KB
testcase_05 AC 1,276 ms
10,472 KB
testcase_06 AC 1,306 ms
10,436 KB
testcase_07 AC 1,270 ms
10,516 KB
testcase_08 AC 1,123 ms
10,380 KB
testcase_09 AC 1,130 ms
10,432 KB
testcase_10 AC 1,078 ms
10,448 KB
testcase_11 AC 1,240 ms
10,524 KB
testcase_12 AC 1,256 ms
10,444 KB
testcase_13 AC 1,326 ms
10,528 KB
testcase_14 AC 1,620 ms
10,344 KB
testcase_15 AC 1,641 ms
10,388 KB
testcase_16 AC 1,660 ms
10,448 KB
testcase_17 AC 1,670 ms
10,492 KB
testcase_18 AC 1,172 ms
10,524 KB
testcase_19 AC 1,207 ms
10,500 KB
testcase_20 AC 1,204 ms
10,408 KB
testcase_21 AC 1,203 ms
10,432 KB
testcase_22 AC 1,171 ms
10,496 KB
testcase_23 AC 1,492 ms
10,408 KB
testcase_24 AC 1,450 ms
10,416 KB
testcase_25 AC 1,470 ms
10,524 KB
testcase_26 AC 1,457 ms
10,464 KB
testcase_27 AC 1,440 ms
10,556 KB
testcase_28 AC 1,398 ms
10,544 KB
testcase_29 AC 1,370 ms
10,512 KB
testcase_30 AC 1,392 ms
10,472 KB
testcase_31 AC 1,373 ms
10,492 KB
testcase_32 AC 1,388 ms
10,404 KB
testcase_33 AC 1,534 ms
10,616 KB
testcase_34 AC 1,564 ms
10,544 KB
testcase_35 AC 1,581 ms
10,532 KB
testcase_36 AC 1,549 ms
10,564 KB
testcase_37 AC 1,579 ms
10,496 KB
testcase_38 AC 1,408 ms
10,644 KB
testcase_39 AC 1,391 ms
10,568 KB
testcase_40 AC 1,441 ms
10,492 KB
testcase_41 AC 1,443 ms
10,588 KB
testcase_42 AC 1,444 ms
10,572 KB
testcase_43 AC 783 ms
10,332 KB
testcase_44 AC 991 ms
10,448 KB
testcase_45 AC 1,294 ms
10,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import functools
import heapq
import itertools
import math
import random
import sys
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
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
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

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,Q[i]/100)
_heapify_max(P)
ans=0
pro=1
for _ in range(10**6):
    p,q=_heappop_max(P)
    ans+=pro
    pro-=p
    _heappush_max(P,(p*(1-q),q))
print(ans)
0