結果
問題 | No.210 探し物はどこですか? |
ユーザー | vwxyz |
提出日時 | 2021-09-25 01:25:05 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 1,864 ms / 2,000 ms |
コード長 | 970 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 10,968 KB |
実行使用メモリ | 10,680 KB |
最終ジャッジ日時 | 2023-09-18 22:36:31 |
合計ジャッジ時間 | 72,864 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,351 ms
10,536 KB |
testcase_01 | AC | 1,573 ms
10,556 KB |
testcase_02 | AC | 1,646 ms
10,608 KB |
testcase_03 | AC | 1,414 ms
10,412 KB |
testcase_04 | AC | 1,347 ms
10,536 KB |
testcase_05 | AC | 1,315 ms
10,336 KB |
testcase_06 | AC | 1,344 ms
10,356 KB |
testcase_07 | AC | 1,371 ms
10,408 KB |
testcase_08 | AC | 1,274 ms
10,336 KB |
testcase_09 | AC | 1,273 ms
10,416 KB |
testcase_10 | AC | 1,234 ms
10,336 KB |
testcase_11 | AC | 1,329 ms
10,340 KB |
testcase_12 | AC | 1,325 ms
10,464 KB |
testcase_13 | AC | 1,573 ms
10,488 KB |
testcase_14 | AC | 1,818 ms
10,460 KB |
testcase_15 | AC | 1,744 ms
10,432 KB |
testcase_16 | AC | 1,743 ms
10,424 KB |
testcase_17 | AC | 1,864 ms
10,488 KB |
testcase_18 | AC | 1,262 ms
10,376 KB |
testcase_19 | AC | 1,285 ms
10,488 KB |
testcase_20 | AC | 1,235 ms
10,428 KB |
testcase_21 | AC | 1,283 ms
10,464 KB |
testcase_22 | AC | 1,275 ms
10,452 KB |
testcase_23 | AC | 1,626 ms
10,508 KB |
testcase_24 | AC | 1,528 ms
10,584 KB |
testcase_25 | AC | 1,518 ms
10,500 KB |
testcase_26 | AC | 1,577 ms
10,472 KB |
testcase_27 | AC | 1,540 ms
10,508 KB |
testcase_28 | AC | 1,514 ms
10,456 KB |
testcase_29 | AC | 1,556 ms
10,464 KB |
testcase_30 | AC | 1,563 ms
10,520 KB |
testcase_31 | AC | 1,582 ms
10,496 KB |
testcase_32 | AC | 1,496 ms
10,528 KB |
testcase_33 | AC | 1,706 ms
10,680 KB |
testcase_34 | AC | 1,703 ms
10,644 KB |
testcase_35 | AC | 1,661 ms
10,616 KB |
testcase_36 | AC | 1,628 ms
10,612 KB |
testcase_37 | AC | 1,688 ms
10,544 KB |
testcase_38 | AC | 1,682 ms
10,620 KB |
testcase_39 | AC | 1,630 ms
10,616 KB |
testcase_40 | AC | 1,719 ms
10,664 KB |
testcase_41 | AC | 1,640 ms
10,656 KB |
testcase_42 | AC | 1,667 ms
10,588 KB |
testcase_43 | AC | 832 ms
10,404 KB |
testcase_44 | AC | 1,392 ms
10,408 KB |
testcase_45 | AC | 1,433 ms
10,412 KB |
ソースコード
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)