/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 15ms 2.988 MiB
#2 Accepted 323ms 7.406 MiB
#3 Time Exceeded ≥1081ms ≥7.281 MiB
#4 Time Exceeded ≥1083ms ≥7.273 MiB
#5 Time Exceeded ≥1092ms ≥13.367 MiB
#6 Time Exceeded ≥1086ms ≥13.441 MiB

Code


def solve_queries(N, A, Q, queries):
   
    min_value = float('inf')
    min_index = -1


    for i in range(N):
        if A[i] < min_value:
            min_value = A[i]
            min_index = i

 
    for X in queries:

        print(min_index + 1)  


        A[min_index] = X

        min_value = float('inf')
        for i in range(N):
            if A[i] < min_value:
                min_value = A[i]
                min_index = i

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
queries = [int(input()) for _ in range(Q)]

solve_queries(N, A, Q, queries)


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:56:03
Judged At
2024-10-03 13:29:24
Judged By
Score
20
Total Time
≥1092ms
Peak Memory
≥13.441 MiB