think-cell Round 1

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1930 think-cell Round 1 FINISHED False 10800 28999463 Feb. 17, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 208 ) H Interactive Mex Tree PROGRAMMING interactive

B'This is an interactive problem. Alice has a tree T consisting of n nodes, numbered from 1 to n . Alice will show T to Bob. After observing T , Bob needs to tell Alice two permutations p_1 and p_2 of [1, 2, ldots, n] . Then, Alice will play q rounds of the following game. Note that all rounds are independent of each other. In particular, the values of a , u and v can be different in different rounds. Bob is puzzled as he only knows the HLD solution, which requires O( log(n)) queries per round. So he needs your help to win the game. ^ dagger The operatorname{MEX} (minimum excludant) of a collection of integers c_1, c_2, ldots, c_k is defined as the smallest non-negative integer x which does not occur in the collection c . Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Read it. The description of the test cases follows. The first line of each test case contains two positive integers n and q ( 2 <= q n <= q 10^5 , 1 <= q q <= q 10^4 ) -- the number of nodes in T and the number of rounds respectively. The following next n-1 lines contains two integers u and v ( 1 <= q u, v <= q n , u neq v ) -- denoting an edge between nodes u and v . It is guaranteed that the given edges form a tree. It is guaranteed that the sum of n and q over all test cases does not exceed 10^5 and 10^4 respectively. It is also guaranteed that the sum of n cdot q does not exceed 3 cdot 10^6 . The interaction for each test case begins by outputting two permutations p_1 and p_2 of [1, 2, ldots, n] . On a new line, output n space-separated distinct integers denoting p_1 . In the next line, output n space-separated distinct integers denoting '...

Tutorials

think-cell Round 1 Editorial

Submissions

No solutions yet.