結果
問題 |
No.210 探し物はどこですか?
|
ユーザー |
|
提出日時 | 2021-07-03 23:26:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 611 ms / 2,000 ms |
コード長 | 822 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 82,268 KB |
実行使用メモリ | 79,312 KB |
最終ジャッジ日時 | 2024-06-30 15:30:56 |
合計ジャッジ時間 | 23,915 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) n = int(input()) p = list(map(int, input().split())) q = list(map(int, input().split())) p = [v/1000 for v in p] q = [v/100 for v in q] from heapq import heappop as hpp, heappush as hp, heappushpop as hppp, heapreplace as hr, heapify from random import random as r def sub(): h = [(-v*q[i],i) for i,v in enumerate(p)] heapify(h) ans = 0 count = [0]*n total = 1 pp = 1 for ii in range(10**6): pr,i = h[0] pr *= -1 pr2 = (1-q[i])*pr hr(h, (-pr2, i)) ans += (ii+1)*pr # print(ans, pr) return ans ans = sub() print(ans)