{"problem":{"name":"139. Dynamic Sorting","description":{"content":"Your computer outputs $n$ integers randomly. You think it might be a secret code, so you decide to make a list of the numbers, but maintain the list in sorted order as you add each number. For exampl","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269139"},"statements":[{"statement_type":"Markdown","content":"Your computer outputs $n$ integers randomly. You think it might be a secret code, so you decide to make a list of the numbers, but maintain the list in sorted order as you add each number.\n\nFor example, if the computer output was $3$ $4$ $2$ $8$ $7$, you would first add $3$ to the list, making the list _[3]_.\n\nThen, you would add $4$ to the list, making the list _[3, 4]_.\n\nThen, you add $2$, putting it first in the list to maintain the list's sorted order. The list becomes _[2, 3, 4]_\n\nThe process proceeds until the list is _[2, 3, 4, 7, 8]_ after the final step.\n\nThe first line of input contains a positive integer $n$: the amount of numbers your computer has printed out.\n\nThe next $n$ lines contain $n$ integers: the numbers that your computer printed out.\n\nOutput $n$ lines. On the $k$th line, output $k$ integers: the sorted list after adding the $k$th number from the computer's output to the list.\n\n## Input\n\nThe first line of input contains a positive integer $n$: the amount of numbers your computer has printed out.The next $n$ lines contain $n$ integers: the numbers that your computer printed out.\n\n## Output\n\nOutput $n$ lines. On the $k$th line, output $k$ integers: the sorted list after adding the $k$th number from the computer's output to the list.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of integers.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be the sequence of integers from input.  \nLet $ L_k $ be the sorted list after inserting the first $ k $ elements of $ A $, for $ k \\in \\{1, \\dots, n\\} $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq \\text{large enough for practical sorting} $  \n2. Each $ a_i \\in \\mathbb{Z} $\n\n**Objective**  \nFor each $ k \\in \\{1, \\dots, n\\} $, output the sorted list $ L_k = \\text{sort}(a_1, a_2, \\dots, a_k) $ as a sequence of $ k $ integers in non-decreasing order.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269139","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}