Accepted
Code
import heapq
def solve(n, arr, q):
min_heap = [(val, idx) for idx, val in enumerate(arr)]
heapq.heapify(min_heap)
for _ in range(q):
min_val, min_idx = heapq.heappop(min_heap)
print(min_idx + 1)
x = int(input())
heapq.heappush(min_heap, (x, min_idx))
n = int(input())
arr = list(map(int, input().split()))
q = int(input())
solve(n, arr, q)
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:53:33
- Judged At
- 2024-11-11 03:17:00
- Judged By
- Score
- 100
- Total Time
- 690ms
- Peak Memory
- 21.168 MiB