{"problem":{"name":"01Sequence","description":{"content":"Consider a sequence of length $N$ consisting of `0`s and `1`s, $A=(A_1,A_2,\\dots,A_N)$, that satisfies the following condition. > For every $i=1,2,\\dots,M$, there are at least $X_i$ occurrences of `1","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc216_g"},"statements":[{"statement_type":"Markdown","content":"Consider a sequence of length $N$ consisting of `0`s and `1`s, $A=(A_1,A_2,\\dots,A_N)$, that satisfies the following condition.\n\n> For every $i=1,2,\\dots,M$, there are at least $X_i$ occurrences of `1` among $A_{L_i}, A_{L_i+1}, \\dots, A_{R_i}$.\n\nPrint one such sequence with the **fewest** number of occurrences of `1`s.\nThere always exists a sequence that satisfies the condition under the Constraints.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq M \\leq \\min(2 \\times 10^5, \\frac{N(N+1)}{2} )$\n*   $1 \\leq L_i \\leq R_i \\leq N$\n*   $1 \\leq X_i \\leq R_i-L_i+1$\n*   $(L_i,R_i) \\neq (L_j,R_j)$ if $i \\neq j$.\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$L_1$ $R_1$ $X_1$\n$L_2$ $R_2$ $X_2$\n$\\vdots$\n$L_M$ $R_M$ $X_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc216_g","tags":[],"sample_group":[["6 3\n1 4 3\n2 2 1\n4 6 2","0 1 1 1 0 1 \n\nAnother acceptable output is `1 1 0 1 1 0`.  \nOn the other hand, `0 1 1 1 1 1`, which has more than the fewest number of `1`s, is unacceptable."],["8 2\n2 6 1\n3 5 3","0 0 1 1 1 0 0 0"]],"created_at":"2026-03-03 11:01:14"}}