# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
919888 | vjudge1 | 원숭이와 사과 나무 (IZhO12_apple) | Cpython 2 | 55 ms | 262144 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
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 |
---|---|---|---|---|
Fetching results... |