This page is still under construction.

Parts of this page are still being built. What you see may change.

Insert Balls

Interview

Time limit1sMemory limit256 MB

Summary
Fill N baskets by writing ball number k into baskets i through j for each operation, then print all baskets.
Level

Easy1 of 10

Topics
Array, Simulation
Solved
No attempts yet

Problem

After range insert operations, print each basket.

Input

N, M, and M range assignments i j k.

Output

Print ball numbers; 0 means empty.

Examples1

  1. Example 1

    Input
    5 4
    1 2 3
    3 4 4
    1 4 1
    2 2 2
    
    Expected output
    1 2 1 1 0