Codeforces Round 923 (Div. 3)

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
1927 Codeforces Round 923 (Div. 3) FINISHED False 8100 24592499 Feb. 6, 2024, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 33465 ) B Following the String PROGRAMMING constructive algorithms greedy strings

B'Polycarp lost the string s of length n consisting of lowercase Latin letters, but he still has its trace. The trace of the string s is an array a of n integers, where a_i is the number of such indices j ( j < i ) that s_i=s_j . For example, the trace of the string abracadabra is the array [ 0, 0, 0, 1, 0, 2, 0, 3, 1, 1, 4 ]. Given a trace of a string, find any string s from which it could have been obtained. The string s should consist only of lowercase Latin letters a-z. The first line of the input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then the descriptions of the test cases follow. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of the lost string. The second line of each test case contains n integers a_1, a_2, ... , a_n ( 0 <= a_i < n ) -- the trace of the string. It is guaranteed that for the given trace, there exists a suitable string s . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a string s that corresponds to the given trace. If there are multiple such strings s , then output any of them. The string s should consist of lowercase Latin letters a-z. It is guaranteed that for each test case, a valid answer exists. '...

Tutorials

125597

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
245237663 wollohq B Feb. 6, 2024, 5:38 p.m. OK C# 10 TESTS 4 61 14540800
245274221 kokora B Feb. 7, 2024, 12:44 a.m. OK C# 10 TESTS 6 62 16896000
245269288 abdoalmowafy B Feb. 6, 2024, 10:41 p.m. OK C# 10 TESTS 6 78 14438400
245274436 _Ghoco_ B Feb. 7, 2024, 12:49 a.m. OK C# 10 TESTS 6 186 27033600
245275205 bluemegane B Feb. 7, 2024, 1:08 a.m. OK C# 8 TESTS 6 140 20889600
245293263 UdayKottana B Feb. 7, 2024, 5:50 a.m. OK Clang++17 Diagnostics TESTS 6 1497 819200
245269011 itachi_1609 B Feb. 6, 2024, 10:36 p.m. OK Clang++20 Diagnostics TESTS 6 826 14643200

remove filters

Back to search problems