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
( 745 ) F Maximize the Difference PROGRAMMING bitmasks brute force dfs and similar

B'For an array b of m non-negative integers, define f(b) as the maximum value of max limits_{i = 1}^{m} (b_i | x) - min limits_{i = 1}^{m} (b_i | x) over all possible non-negative integers x , where | is bitwise OR operation. You are given integers n and q . You start with an empty array a . Process the following q queries: The queries are given in a modified way. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 2 cdot 10^5 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and q ( 1 <= q n <= q 2^{22} , 1 <= q q <= q 10^6 ) -- the number of queries. The second line of each test case contains q space-separated integers e_1,e_2, ldots,e_q ( 0 <= q e_i < n ) -- the encrypted values of v . Let mathrm{last}_i equal the output of the (i-1) -th query for i geq 2 and mathrm{last}_i=0 for i=1 . Then the value of v for the i -th query is ( e_i + mathrm{last}_i ) modulo n . It is guaranteed that the sum of n over all test cases does not exceed 2^{22} and the sum of q over all test cases does not exceed 10^6 . For each test case, print q integers. The i -th integer is the output of the i -th query. In the first test case, the final a=[1,2] . For i=1 , the answer is always 0 , irrespective of x . For i=2 , we can select x=5 . In the second test case, the final a=[3,1,0,5] . '...

Tutorials

think-cell Round 1 Editorial

Submissions

No solutions yet.