Submission details
Task:Lucky prefixes
Sender:Casinosort
Submission time:2025-11-08 14:38:52 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#2--details
#30.04 sdetails
#40.42 sdetails
#5--details
#61.00 sdetails
#7--details
#8--details
#9--details
#100.04 sdetails
#110.42 sdetails
#12--details
#131.01 sdetails
#14--details
#15--details
#16--details

Code

line = input().split()

n = int(line[0])
q = int(line[1])

line = input().split()
numbers = []
for i in range(n):
    numbers.append(int(line[i]))

for i in range(q):
    checker = True
    line = input().split()
    t = int(line[0])
    a = int(line[1])
    b = int(line[2])
    #print(t,a,b)
    if t == 1:
        numbers[a-1] = b
    else:
        for r in range(a-1,b):
            if sum(numbers[a-1:r]) < 0:
                print("NO")
                checker = False
                break
        if checker:
            print("YES")

Test details

Test 1

Verdict: ACCEPTED

input
6 4
3 -2 1 5 6 1
2 1 3
2 2 3
1 3 -2
...

correct output
YES
NO
NO

user output
YES
NO
NO

Test 2

Verdict:

input
200000 200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 3

Verdict:

input
10 10
629447384 -729045992 811583872...

correct output
YES
NO
NO
NO
NO
...

user output
YES
YES
NO
YES
NO
...

Feedback: Incorrect character on line 2 col 1: expected "NO", got "YES"

Test 4

Verdict:

input
1 200000
629447384
1 1 670017180
1 1 826751744
1 1 -804919168
...

correct output
NO
NO
NO
YES
YES
...

user output
YES
YES
YES
YES
YES
...

Feedback: Incorrect character on line 1 col 1: expected "NO", got "YES"

Test 5

Verdict:

input
200000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 6

Verdict:

input
1000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
NO
NO
NO
NO
NO
...

Feedback: Incorrect character on line 2363 col 1: expected "NO", got "YES"

Test 7

Verdict:

input
10000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 8

Verdict:

input
100000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 9

Verdict:

input
200000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 10

Verdict:

input
10 10
629447384 -729045992 811583872...

correct output
YES
NO
NO
NO
NO
...

user output
YES
YES
NO
YES
NO
...

Feedback: Incorrect character on line 2 col 1: expected "NO", got "YES"

Test 11

Verdict:

input
1 200000
629447384
1 1 670017180
1 1 826751744
1 1 -804919168
...

correct output
NO
NO
NO
YES
YES
...

user output
YES
YES
YES
YES
YES
...

Feedback: Incorrect character on line 1 col 1: expected "NO", got "YES"

Test 12

Verdict:

input
200000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 13

Verdict:

input
1000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
NO
NO
NO
NO
NO
...

Feedback: Incorrect character on line 2363 col 1: expected "NO", got "YES"

Test 14

Verdict:

input
10000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 15

Verdict:

input
100000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)

Test 16

Verdict:

input
200000 200000
629447384 -729045992 811583872...

correct output
NO
NO
NO
NO
NO
...

user output
(empty)