답안 #919714

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
919714 2024-02-01T14:22:32 Z vjudge1 원숭이와 사과 나무 (IZhO12_apple) Python 3
0 / 100
11 ms 2908 KB
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 -