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 23642699 Feb. 17, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7165 ) C Lexicographically Largest PROGRAMMING constructive algorithms data structures greedy sortings

B'Stack has an array a of length n . He also has an empty set S . Note that S is not a multiset. He will do the following three-step operation exactly n times: Note that after n operations, a will be empty. Stack will now construct a new array b which is S sorted in decreasing order. Formally, b is an array of size |S| where b_i is the i -th largest element of S for all 1 <= q i <= q |S| . Find the lexicographically largest ^ ddagger b that Stack can make. ^ dagger A set can only contain unique elements. Inserting an element that is already present in a set will not change the elements of the set. ^ ddagger An array p is lexicographically larger than a sequence q if and only if one of the following holds: Note that [3,1,4,1,5] is lexicographically larger than [3,1,3] , [ ,] , and [3,1,4,1] but not [3,1,4,1,5,9] , [3,1,4,1,5] , and [4] . 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. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 3 cdot 10^5 ) -- the length of array a . The second line of each test case contains n integers a_1,a_2, ldots,a_{n} ( 1 <= q a_i <= q 10^9 ) -- the elements of array a . The sum of n over all test cases does not exceed 3 cdot 10^5 . For each test case, output the lexicographically largest b . In the first test case, select i=1 in the first operation, insert a_1 + 1 = 3 in S , and delete a_1 from a . After the first operation, a becomes a=[1] . In the second operation, we select i=1 again and insert a_1 + 1 = 2 in S . Thus S= {2, 3 } , and b = [3, 2] . Note that if you select i=2 i'...

Tutorials

think-cell Round 1 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
246943312 Chio C Feb. 18, 2024, 5:46 a.m. OK C# 10 TESTS 15 171 47718400

remove filters

Back to search problems