結果

問題 No.210 探し物はどこですか?
ユーザー vwxyzvwxyz
提出日時 2021-09-25 01:25:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,792 ms / 2,000 ms
コード長 970 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 101,196 KB
最終ジャッジ日時 2023-09-18 22:37:52
合計ジャッジ時間 68,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,245 ms
95,664 KB
testcase_01 AC 1,489 ms
97,432 KB
testcase_02 AC 1,655 ms
101,196 KB
testcase_03 AC 1,258 ms
95,268 KB
testcase_04 AC 1,118 ms
94,892 KB
testcase_05 AC 1,083 ms
95,808 KB
testcase_06 AC 1,148 ms
95,444 KB
testcase_07 AC 1,138 ms
95,328 KB
testcase_08 AC 1,047 ms
95,212 KB
testcase_09 AC 1,043 ms
95,332 KB
testcase_10 AC 1,048 ms
95,420 KB
testcase_11 AC 1,112 ms
95,256 KB
testcase_12 AC 1,051 ms
95,940 KB
testcase_13 AC 1,379 ms
95,912 KB
testcase_14 AC 1,524 ms
95,392 KB
testcase_15 AC 1,525 ms
95,400 KB
testcase_16 AC 1,468 ms
95,480 KB
testcase_17 AC 1,636 ms
95,700 KB
testcase_18 AC 1,158 ms
95,716 KB
testcase_19 AC 1,186 ms
95,360 KB
testcase_20 AC 1,177 ms
95,520 KB
testcase_21 AC 1,185 ms
95,412 KB
testcase_22 AC 1,170 ms
95,256 KB
testcase_23 AC 1,565 ms
98,056 KB
testcase_24 AC 1,563 ms
98,156 KB
testcase_25 AC 1,553 ms
98,040 KB
testcase_26 AC 1,570 ms
98,184 KB
testcase_27 AC 1,611 ms
98,024 KB
testcase_28 AC 1,532 ms
97,920 KB
testcase_29 AC 1,539 ms
97,592 KB
testcase_30 AC 1,529 ms
97,952 KB
testcase_31 AC 1,520 ms
97,616 KB
testcase_32 AC 1,552 ms
97,900 KB
testcase_33 AC 1,789 ms
100,788 KB
testcase_34 AC 1,767 ms
101,000 KB
testcase_35 AC 1,748 ms
100,860 KB
testcase_36 AC 1,792 ms
100,932 KB
testcase_37 AC 1,749 ms
100,488 KB
testcase_38 AC 1,699 ms
100,408 KB
testcase_39 AC 1,692 ms
100,460 KB
testcase_40 AC 1,711 ms
100,652 KB
testcase_41 AC 1,737 ms
100,428 KB
testcase_42 AC 1,701 ms
100,372 KB
testcase_43 AC 287 ms
94,764 KB
testcase_44 AC 1,179 ms
94,960 KB
testcase_45 AC 1,188 ms
95,332 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,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