def monkey_and_apple_trees(events):
C = 0
results = []
for event in events:
if event[0] == 2:
_, Xi, Yi = event
C += 0
else:
_, Xi, Yi = event
interval = [Xi + C, Yi + C]
C = interval.count(1)
results.append(C)
return results
# Example usage:
events = [
(2, 5, 8),
(2, 7, 10),
(1, 1, 10),
(2, 2, 3),
(1, 1, 3),
(2, 2, 3),
(2, 1, 7),
(2, 10, 12),
(1, 7, 11),
(2, 11, 13),
(1, 8, 10),
(1, 15, 17)
]
results = monkey_and_apple_trees(events)
for result in results:
print(result)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
11 ms |
2908 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |