/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 21ms 3.168 MiB
#2 Wrong Answer 335ms 3.695 MiB

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-11-11 03:17:17
Judged By
Score
0
Total Time
335ms
Peak Memory
3.695 MiB