Codeforces Round 940 (Div. 2) and CodeCraft-23

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
1957 Codeforces Round 940 (Div. 2) and CodeCraft-23 FINISHED False 8100 23469863 April 21, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 520 ) F1 Frequency Mismatch (Easy Version) PROGRAMMING binary search data structures divide and conquer hashing probabilities trees 2600

B'This is the easy version of the problem. The difference between the two versions of this problem is the constraint on k . You can make hacks only if all versions of the problem are solved. You are given an undirected tree of n nodes. Each node v has a value a_v written on it. You have to answer queries related to the tree. You are given q queries. In each query, you are given 5 integers, u_1, v_1, u_2, v_2, k . Denote the count of nodes with value c on path u_1 rightarrow v_1 with x_c , and the count of nodes with value c on path u_2 rightarrow v_2 with y_c . If there are z such values of c such that x_c neq y_c , output any min(z, k) such values in any order. The first line contains one integer n ( 1 <= q n <= q 10^5 ) -- the number of nodes in the tree. The next line contains n integers, a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^5 ) -- the value written on each node of the tree. Then n - 1 lines follow. Each line contains two integers u and v ( 1 <= q u, v <= q n, u neq v ) denoting an edge of the tree. It is guaranteed that the given edges form a tree. The next line contains one integer q ( 1 <= q q <= q 10^5 ) -- the number of queries. Then q lines follow. Each line contains five integers u_1, v_1, u_2, v_2, k ( 1 <= q u_1, v_1, u_2, v_2 <= q n , k = 1 ). For each query, output on a separate line. For a query, first output min(z, k) and then on the same line, output any min(z, k) values in any order which occur a different number of times in each path. For query 1 , the first path is 1 rightarrow 2 rightarrow 4 , coming across the multiset of values {5, 2, 4 } . On the second path 4 rightarrow 2 rightarrow 5 , we have the multiset {4, 2, 3 } . Two numbers -- 3 and 5 occur a different number of times, hence we '...

Tutorials

Codeforces Round #940 and CodeCraft-23 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
258672485 Kanosword F1 April 29, 2024, 11:15 a.m. OK C++14 (GCC 6-32) TESTS 65 452 41267200 2600
259818089 yiyezhiqiu5959 F1 May 7, 2024, 2:43 a.m. OK C++14 (GCC 6-32) TESTS 65 500 53760000 2600
261591210 CF_xyy F1 May 19, 2024, 2:26 a.m. OK C++14 (GCC 6-32) TESTS 65 515 47718400 2600
263222283 rotcar08 F1 May 30, 2024, 10:30 a.m. OK C++14 (GCC 6-32) TESTS 65 608 111718400 2600
259512870 luogu_bot2 F1 May 4, 2024, 1:17 p.m. OK C++14 (GCC 6-32) TESTS 65 608 179097600 2600
259829109 liyouran F1 May 7, 2024, 5:34 a.m. OK C++14 (GCC 6-32) TESTS 65 640 107827200 2600
261523205 Trickstar_is_the_best F1 May 18, 2024, 11:36 a.m. OK C++14 (GCC 6-32) TESTS 65 671 48332800 2600
258846278 Williamxzh F1 April 30, 2024, 11:40 a.m. OK C++14 (GCC 6-32) TESTS 65 703 118272000 2600
259039157 ImmortaLimit F1 May 1, 2024, 5:22 p.m. OK C++14 (GCC 6-32) TESTS 65 812 128512000 2600
259039235 ImmortaLimit F1 May 1, 2024, 5:23 p.m. OK C++14 (GCC 6-32) TESTS 65 859 128512000 2600
263005984 Raisen_zhx F1 May 28, 2024, 11:58 a.m. OK C++17 (GCC 7-32) TESTS 65 421 247910400 2600
263005914 Raisen_zhx F1 May 28, 2024, 11:57 a.m. OK C++17 (GCC 7-32) TESTS 65 436 247910400 2600
259990416 _cly_ F1 May 8, 2024, 11:31 a.m. OK C++17 (GCC 7-32) TESTS 65 452 75264000 2600
262870774 Raisen_zhx F1 May 27, 2024, 11:23 a.m. OK C++17 (GCC 7-32) TESTS 65 468 247910400 2600
259993428 _cly_ F1 May 8, 2024, 11:55 a.m. OK C++17 (GCC 7-32) TESTS 65 483 75264000 2600
258412005 a999999 F1 April 27, 2024, 1:38 p.m. OK C++17 (GCC 7-32) TESTS 65 531 64102400 2600
259455401 YeahPotato F1 May 4, 2024, 6:32 a.m. OK C++17 (GCC 7-32) TESTS 65 546 36761600 2600
259512734 Kevin_s1mple F1 May 4, 2024, 1:16 p.m. OK C++17 (GCC 7-32) TESTS 65 561 179097600 2600
258551844 r-2 F1 April 28, 2024, 10:59 a.m. OK C++17 (GCC 7-32) TESTS 65 608 103731200 2600
259440474 Junz_LJL F1 May 4, 2024, 3:29 a.m. OK C++17 (GCC 7-32) TESTS 65 624 129228800 2600
259104693 chenhongrui F1 May 2, 2024, 9:12 a.m. OK C++20 (GCC 13-64) TESTS 65 265 71987200 2600
260085081 Clein.qwq F1 May 9, 2024, 7:23 a.m. OK C++20 (GCC 13-64) TESTS 65 311 67686400 2600
260083821 Clein.qwq F1 May 9, 2024, 7:10 a.m. OK C++20 (GCC 13-64) TESTS 65 327 67686400 2600
259837617 superyijin_txdy F1 May 7, 2024, 7:05 a.m. OK C++20 (GCC 13-64) TESTS 65 421 137625600 2600
258324049 Icelast F1 April 27, 2024, 4 a.m. OK C++20 (GCC 13-64) TESTS 65 436 72601600 2600
258684225 nifeshe F1 April 29, 2024, 12:19 p.m. OK C++20 (GCC 13-64) TESTS 65 452 84275200 2600
258178927 DylanSmith F1 April 26, 2024, 3:25 a.m. OK C++20 (GCC 13-64) TESTS 65 468 214937600 2600
259284238 Farmer_D F1 May 3, 2024, 1:15 a.m. OK C++20 (GCC 13-64) TESTS 65 483 76288000 2600
258775331 mohaiminul_islam F1 April 29, 2024, 5:49 p.m. OK C++20 (GCC 13-64) TESTS 65 530 68300800 2600
258253937 peti1234 F1 April 26, 2024, 3:15 p.m. OK C++20 (GCC 13-64) TESTS 65 530 72704000 2600
260001480 timiss F1 May 8, 2024, 12:54 p.m. OK Kotlin 1.9 TESTS 65 2827 184832000 2600

remove filters

Back to search problems