Submission #919889

# Submission time Handle Problem Language Result Execution time Memory
919889 2024-02-01T19:25:17 Z vjudge1 Monkey and Apple-trees (IZhO12_apple) Python 3
0 / 100
55 ms 262144 KB
M = int(input())
apple_trees = [0] * 1000000000  # initialize list with all zeros
C = 0

for _ in range(M):
    D, X, Y = map(int, input().split())
    if D == 1:
        count = 0
        for i in range(X+C, Y+C+1):
            if apple_trees[i] == 1:
                count += 1
        print(count)
        C = count
    elif D == 2:
        for i in range(X+C, Y+C+1):
            apple_trees[i] = 1
# Verdict Execution time Memory Grader output
1 Runtime error 55 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -