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 |
---|---|---|---|---|---|---|
1491 | Codeforces Global Round 13 | FINISHED | False | 10800 | 117303899 | Feb. 28, 2021, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 892 ) | H | Yuezheng Ling and Dynamic Tree | PROGRAMMING | data structures |
B"Yuezheng Ling gives Luo Tianyi a tree which has n nodes, rooted at 1 . Luo Tianyi will tell you that the parent of the i -th node is a_i ( 1 <= q a_i<i for 2 <= i <= n ), and she will ask you to perform q queries of 2 types: The first line contains two integers n and q ( 2 <= q n,q <= q 10^5 ) -- the number of nodes and the number of queries, respectively. The second line contains n-1 integers a_2, a_3, ... , a_n ( 1 <= a_i < i ), where a_i is the parent of the node i . Next q lines contain queries. For each query, the first integer of each line is t ( t = 1 or 2 ) -- the type of the query. If t = 1 , this represents the query of the first type. Then, three integers will follow: l , r , x ( 2 <= l <= r <= n , 1 <= x <= 10^5 ), meaning that you have to replace a_i with max(a_i-x,1) for all i with l <= q i <= q r . If t = 2 , this represents the query of the second type. Then, two integers will follow: u and v ( 1 <= u, v <= n ), and you have to find the LCA of u and v . It's guaranteed that there is at least one query of the second type. For each query of the second type output answer on a new line. The tree in example is shown below. After the query of the first type, the tree changes and is looking as shown below. "... |
Codeforces Global Round 13 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
108763811 | LJC00118 | H | March 1, 2021, 1:48 a.m. | OK | GNU C++11 | TESTS | 27 | 280 | 819200 | ||
108763473 | Wu_Ren | H | March 1, 2021, 1:34 a.m. | OK | GNU C++11 | TESTS | 27 | 295 | 1228800 | ||
108766222 | jzp | H | March 1, 2021, 3:19 a.m. | OK | GNU C++11 | TESTS | 27 | 311 | 1228800 | ||
108771453 | Hongzy | H | March 1, 2021, 5:21 a.m. | OK | GNU C++11 | TESTS | 27 | 312 | 4198400 | ||
108772469 | dijkstra54321 | H | March 1, 2021, 5:40 a.m. | OK | GNU C++11 | TESTS | 27 | 327 | 5017600 | ||
108771617 | WinterSpell | H | March 1, 2021, 5:24 a.m. | OK | GNU C++11 | TESTS | 27 | 343 | 1228800 | ||
108763776 | Suiseiseki | H | March 1, 2021, 1:47 a.m. | OK | GNU C++11 | TESTS | 27 | 358 | 614400 | ||
108763599 | cutekibry | H | March 1, 2021, 1:40 a.m. | OK | GNU C++11 | TESTS | 27 | 436 | 1228800 | ||
108768982 | Comet_Honeymoon | H | March 1, 2021, 4:38 a.m. | OK | GNU C++11 | TESTS | 27 | 639 | 2150400 | ||
108741131 | Comet_Honeymoon | H | Feb. 28, 2021, 4:26 p.m. | OK | GNU C++11 | TESTS | 27 | 639 | 2150400 |
Back to search problems