Wrong Answer
Code
import sys
from heapq import heapify, heapreplace
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
h = [(v, i) for i, v in enumerate(a)]
heapify(h)
for _ in range(int(input())):
x = int(input())
v, i = h[0]
print(i + 1, end=' ')
heapreplace(h, (max(v, x), i))
a[i] = max(v, x)
print()
Information
- Submit By
- Type
- Submission
- Problem
- P1086 KuZ the Position
- Contest
- Bangladesh 2.0
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-08-16 15:47:53
- Judged At
- 2024-10-03 13:29:51
- Judged By
- Score
- 0
- Total Time
- 608ms
- Peak Memory
- 18.207 MiB