Submission details
Task:Dynamic Range Minimum Queries
Sender:aalto26dh_043
Submission time:2026-09-23 16:09:24 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.50 sdetails

Code

# cook your dish here
n,q = map(int,input().split())
x = list(map(int,input().split()))

c = [0]*(n)
c.extend(x)

for i in range(n-1, 0,-1):
    c[i] = min(c[2*i],c[2*i +1])

for k in range(q):
    p,a,b = map(int, input().split())
    if p == 1:
        d = n+a -1
        c[d] = b
        while d >1:
            d = d//2
            c[d] = min(c[2*d], c[2*d +1])
            
    if p ==2:
        l = n+a-1
        r = n+b-1
        s = 10**9 +1
        

        while l <= r:
            if r%2 == 0:
                s = min(s,c[r])
                r=r-1
                
            else:
                s = min(s,c[l])
                l=l+1
            l=l//2
            r=r//2
            
        print(s)

Test details

Test 1

Verdict:

input
8 80
7 6 4 6 2 9 4 8
2 1 1
2 1 2
2 1 3
...

correct output
7
6
4
4
2
...

user output
7
6
4
4
2
...

Feedback: Incorrect character on line 32 col 1: expected "4", got "2"

Test 2

Verdict:

input
200000 200000
398739055 65343131 699208332 3...

correct output
28609
129890
20378
20378
311522
...

user output
28609
129890
20378
20378
59886
...

Feedback: Incorrect character on line 5 col 1: expected "311522", got "59886"