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 |
---|---|---|---|---|---|---|
1623 | Codeforces Round 763 (Div. 2) | FINISHED | False | 7200 | 96481463 | Dec. 28, 2021, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1138 ) | E | Middle Duplication | PROGRAMMING | data structures dfs and similar greedy strings trees |
B"A binary tree of n nodes is given. Nodes of the tree are numbered from 1 to n and the root is the node 1 . Each node can have no child, only one left child, only one right child, or both children. For convenience, let's denote l_u and r_u as the left and the right child of the node u respectively, l_u = 0 if u does not have the left child, and r_u = 0 if the node u does not have the right child. Each node has a string label, initially is a single character c_u . Let's define the string representation of the binary tree as the concatenation of the labels of the nodes in the in-order. Formally, let f(u) be the string representation of the tree rooted at the node u . f(u) is defined as follows: f(u) = begin{cases} texttt{<empty string>}, & text{if }u = 0; f(l_u) + c_u + f(r_u) & text{otherwise}, end{cases} where + denotes the string concatenation operation. This way, the string representation of the tree is f(1) . For each node, we can duplicate its label at most once, that is, assign c_u with c_u + c_u , but only if u is the root of the tree, or if its parent also has its label duplicated. You are given the tree and an integer k . What is the lexicographically smallest string representation of the tree, if we can duplicate labels of at most k nodes? A string a is lexicographically smaller than a string b if and only if one of the following holds: The first line contains two integers n and k ( 1 <= k <= n <= 2 cdot 10^5 ). The second line contains a string c of n lower-case English letters, where c_i is the initial label of the node i for 1 <= i <= n . Note that the given string c is not the initial string representation of the tree. The i -th of the next n lines contains two integers l_i and r_i ( 0 <= l_i, r_i <= n$$"... |
Codeforces Round #763 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
140969053 | darkkcyan | E | Dec. 28, 2021, 10:06 p.m. | OK | FPC | TESTS | 164 | 109 | 7782400 | ||
140933812 | rainboy | E | Dec. 28, 2021, 3:02 p.m. | OK | GNU C11 | TESTS | 164 | 124 | 17203200 | ||
140972748 | Tyyyyyy | E | Dec. 29, 2021, 1:10 a.m. | OK | GNU C++14 | TESTS | 164 | 109 | 11059200 | ||
140938408 | _xiaocong | E | Dec. 28, 2021, 3:19 p.m. | OK | GNU C++14 | TESTS | 164 | 109 | 11776000 | ||
140975042 | XueYJ | E | Dec. 29, 2021, 2:39 a.m. | OK | GNU C++14 | TESTS | 164 | 109 | 11776000 | ||
140972376 | KazamaHoang | E | Dec. 29, 2021, 12:51 a.m. | OK | GNU C++14 | TESTS | 164 | 124 | 10240000 | ||
140980596 | MayFlyyh | E | Dec. 29, 2021, 4:52 a.m. | OK | GNU C++14 | TESTS | 164 | 124 | 10649600 | ||
140972726 | Tyyyyyy | E | Dec. 29, 2021, 1:09 a.m. | OK | GNU C++14 | TESTS | 164 | 124 | 11059200 | ||
140947106 | 0wuming0 | E | Dec. 28, 2021, 4:20 p.m. | OK | GNU C++14 | TESTS | 164 | 124 | 11059200 | ||
140972735 | bkifhr8 | E | Dec. 29, 2021, 1:10 a.m. | OK | GNU C++14 | TESTS | 164 | 124 | 11059200 | ||
140974880 | nurnijniy | E | Dec. 29, 2021, 2:33 a.m. | OK | GNU C++14 | TESTS | 164 | 124 | 11264000 | ||
140974904 | Werner_Yin | E | Dec. 29, 2021, 2:35 a.m. | OK | GNU C++14 | TESTS | 164 | 124 | 11264000 | ||
140937905 | kuonji_alice | E | Dec. 28, 2021, 3:17 p.m. | OK | GNU C++17 | TESTS | 164 | 109 | 17612800 | ||
140970735 | SuffixBalancedTree | E | Dec. 28, 2021, 11:11 p.m. | OK | GNU C++17 | TESTS | 164 | 109 | 22425600 | ||
140970771 | _FireBladeMaster_ | E | Dec. 28, 2021, 11:12 p.m. | OK | GNU C++17 | TESTS | 164 | 109 | 22425600 | ||
140934744 | Wailydest | E | Dec. 28, 2021, 3:05 p.m. | OK | GNU C++17 | TESTS | 164 | 124 | 9625600 | ||
140971939 | tokusakurai | E | Dec. 29, 2021, 12:32 a.m. | OK | GNU C++17 | TESTS | 164 | 124 | 9830400 | ||
140973178 | SaoST | E | Dec. 29, 2021, 1:29 a.m. | OK | GNU C++17 | TESTS | 164 | 124 | 11366400 | ||
140975533 | stff577 | E | Dec. 29, 2021, 2:54 a.m. | OK | GNU C++17 | TESTS | 164 | 124 | 11980800 | ||
140940397 | relyt871 | E | Dec. 28, 2021, 3:26 p.m. | OK | GNU C++17 | TESTS | 164 | 124 | 13209600 | ||
140975385 | stff577 | E | Dec. 29, 2021, 2:50 a.m. | OK | GNU C++17 | TESTS | 164 | 124 | 28876800 | ||
140954523 | tmdrud | E | Dec. 28, 2021, 5:38 p.m. | OK | GNU C++17 | TESTS | 164 | 139 | 9216000 | ||
140982228 | Ripiaun | E | Dec. 29, 2021, 5:22 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 93 | 21606400 | ||
140972287 | xiaoziyao | E | Dec. 29, 2021, 12:47 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 109 | 21299200 | ||
140974994 | over_flow | E | Dec. 29, 2021, 2:37 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 109 | 21401600 | ||
140949300 | OleschY | E | Dec. 28, 2021, 4:40 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 109 | 21401600 | ||
140947062 | Emaneru | E | Dec. 28, 2021, 4:19 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 109 | 32051200 | ||
140932491 | ChwastPolskiejMlodziezy | E | Dec. 28, 2021, 2:57 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 109 | 32870400 | ||
140935581 | natsugiri | E | Dec. 28, 2021, 3:08 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 124 | 21811200 | ||
140974769 | basic_string | E | Dec. 29, 2021, 2:30 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 124 | 23961600 | ||
140934311 | www | E | Dec. 28, 2021, 3:03 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 124 | 27033600 | ||
140941934 | tabr | E | Dec. 28, 2021, 3:32 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 124 | 27340800 | ||
140945522 | generic_placeholder_name | E | Dec. 28, 2021, 4:08 p.m. | OK | GNU C++20 (64) | TESTS | 164 | 93 | 29286400 | ||
140974420 | chctxdy68 | E | Dec. 29, 2021, 2:18 a.m. | OK | GNU C++20 (64) | TESTS | 164 | 108 | 26419200 | ||
140962248 | Nea1 | E | Dec. 28, 2021, 7:22 p.m. | OK | GNU C++20 (64) | TESTS | 164 | 108 | 26931200 | ||
140962139 | Nea1 | E | Dec. 28, 2021, 7:20 p.m. | OK | GNU C++20 (64) | TESTS | 164 | 108 | 26931200 | ||
140956209 | Lyamzin_alexandr | E | Dec. 28, 2021, 5:58 p.m. | OK | GNU C++20 (64) | TESTS | 164 | 108 | 27750400 | ||
140970065 | silxi | E | Dec. 28, 2021, 10:43 p.m. | OK | GNU C++20 (64) | TESTS | 164 | 108 | 30822400 | ||
140972655 | smax | E | Dec. 29, 2021, 1:06 a.m. | OK | GNU C++20 (64) | TESTS | 164 | 108 | 33280000 | ||
140977760 | Lavine | E | Dec. 29, 2021, 3:52 a.m. | OK | GNU C++20 (64) | TESTS | 164 | 109 | 22118400 | ||
140975084 | hruif | E | Dec. 29, 2021, 2:40 a.m. | OK | GNU C++20 (64) | TESTS | 164 | 109 | 22937600 | ||
140962360 | Nea1 | E | Dec. 28, 2021, 7:24 p.m. | OK | GNU C++20 (64) | TESTS | 164 | 109 | 23756800 | ||
140971747 | mphillotry | E | Dec. 28, 2021, 11:57 p.m. | OK | Java 11 | TESTS | 164 | 841 | 79462400 | ||
140970485 | dzhi | E | Dec. 28, 2021, 11 p.m. | OK | Java 11 | TESTS | 164 | 857 | 31334400 | ||
140970705 | dzhi | E | Dec. 28, 2021, 11:10 p.m. | OK | Java 11 | TESTS | 164 | 920 | 20480000 | ||
140940189 | AndreySiunov | E | Dec. 28, 2021, 3:26 p.m. | OK | Java 8 | TESTS | 164 | 608 | 132300800 | ||
140941027 | elizarov | E | Dec. 28, 2021, 3:29 p.m. | OK | Kotlin 1.5 | TESTS | 164 | 670 | 24985600 | ||
140950225 | machine_solution | E | Dec. 28, 2021, 4:49 p.m. | OK | MS C++ 2017 | TESTS | 164 | 857 | 77926400 | ||
140961653 | OLOGY | E | Dec. 28, 2021, 7:12 p.m. | OK | PyPy 2 | TESTS | 164 | 327 | 33689600 | ||
140961991 | OLOGY | E | Dec. 28, 2021, 7:17 p.m. | OK | PyPy 2 | TESTS | 164 | 358 | 36659200 | ||
140966891 | whatshisbucket | E | Dec. 28, 2021, 8:59 p.m. | OK | PyPy 3 | TESTS | 164 | 514 | 21504000 | ||
140948934 | SPD_9X2 | E | Dec. 28, 2021, 4:37 p.m. | OK | PyPy 3 | TESTS | 164 | 655 | 44646400 | ||
140961671 | OLOGY | E | Dec. 28, 2021, 7:12 p.m. | OK | Python 2 | TESTS | 164 | 967 | 32665600 | ||
140961864 | OLOGY | E | Dec. 28, 2021, 7:15 p.m. | OK | Python 2 | TESTS | 164 | 967 | 32870400 | ||
140935019 | apilat | E | Dec. 28, 2021, 3:06 p.m. | OK | Rust 2021 | TESTS | 164 | 124 | 41779200 | ||
140962153 | clause | E | Dec. 28, 2021, 7:20 p.m. | OK | Rust 2021 | TESTS | 164 | 171 | 29388800 |
Back to search problems