Submission #919714

# Submission time Handle Problem Language Result Execution time Memory
919714 2024-02-01T14:22:32 Z vjudge1 Monkey and Apple-trees (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)
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 2908 KB Output isn't correct
2 Halted 0 ms 0 KB -