Hello 2026

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
2183 Hello 2026 FINISHED False 10800 8609123 Jan. 7, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8734 ) D1 Tree Coloring (Easy Version) PROGRAMMING constructive algorithms dfs and similar greedy trees

This is the Easy version of the problem. The difference between the versions is that in this version, you are only required to find the minimum number of operations. You can hack only if you solved all versions of this problem. You are given a rooted tree(^{\text{∗}}) consisting of (n) vertices numbered from (1) to (n), where the root has index (1), and each vertex is initially white. Define (d_i) as the distance from the root to the (i)-th vertex. You can perform the following operations any number of times: Select a subset (S) of white vertices such that no two nodes in (S) are connected by an edge, or have the same distance to node (1). Formally, (S) should satisfy for all (x,y\in S) and (x\neq y), (d_x\neq d_y) and there are no edges between (x) and (y). Color the vertices in (S) black. (^{\text{∗}})A tree is a connected graph without cycles. A rooted tree is a tree where one vertex is special and called the root. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2\le n\le 2\cdot 10^5)) – the number of vertices in the tree. The (i)-th following (n-1) lines contain two integers (u_i) and (v_i) ((1\le u_i,v_i\le n), (u_i\neq v_i)) – the ends of the (i)-th edge. It is guaranteed that the given edges form a tree. It is guaranteed that the sum of (n) over all test cases doesn't exceed (2\cdot10^5). For each test case, output the minimum number of operations on a new line. In the first test case, (d_1=1) and (d_2=d_3=d_4=d_5=2). We can show that we must perform at least (5) operations because there are no two nodes that can be operated on simultaneously. In the second test case, we can show that the least number of operations required to color the full tr

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
356852184 rithamog D1 Jan. 7, 2026, 4:54 p.m. OK C++17 (GCC 7-32) TESTS 30 125 6451200
356882318 catandcode D1 Jan. 7, 2026, 9:06 p.m. OK C++17 (GCC 7-32) TESTS 30 125 10444800
356852651 venkatroyal1967 D1 Jan. 7, 2026, 4:55 p.m. OK C++17 (GCC 7-32) TESTS 30 140 13619200
356853496 nusratjahannabila D1 Jan. 7, 2026, 4:57 p.m. OK C++17 (GCC 7-32) TESTS 30 156 7270400
356886034 Kareem_wahman D1 Jan. 7, 2026, 10:42 p.m. OK C++17 (GCC 7-32) TESTS 30 171 15360000
356858063 Cwulaek D1 Jan. 7, 2026, 5:11 p.m. OK C++17 (GCC 7-32) TESTS 30 171 31539200
356898572 HeartbeatEngine D1 Jan. 8, 2026, 4 a.m. OK C++17 (GCC 7-32) TESTS 30 171 41984000
356882204 p-space D1 Jan. 7, 2026, 9:04 p.m. OK C++17 (GCC 7-32) TESTS 30 187 17100800
356854005 AiJadeJ_7 D1 Jan. 7, 2026, 4:59 p.m. OK C++17 (GCC 7-32) TESTS 30 187 30720000
356900594 Cwulaek D1 Jan. 8, 2026, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 30 187 31436800
356851772 zhaosicheng210101 D1 Jan. 7, 2026, 4:53 p.m. OK C++20 (GCC 13-64) TESTS 30 109 6451200
356893597 1096mikolu D1 Jan. 8, 2026, 2:39 a.m. OK C++20 (GCC 13-64) TESTS 30 140 18739200
356905419 sarvasvaG952993 D1 Jan. 8, 2026, 5:31 a.m. OK C++20 (GCC 13-64) TESTS 30 171 7372800
356886042 _Dopamine_ D1 Jan. 7, 2026, 10:42 p.m. OK C++20 (GCC 13-64) TESTS 30 187 8089600
356900205 mohitvaranasi2006 D1 Jan. 8, 2026, 4:24 a.m. OK C++20 (GCC 13-64) TESTS 30 187 9523200
356895929 maanassehgal D1 Jan. 8, 2026, 3:19 a.m. OK C++20 (GCC 13-64) TESTS 30 187 10444800
356894986 Jayling D1 Jan. 8, 2026, 3:03 a.m. OK C++20 (GCC 13-64) TESTS 30 187 11673600
356890925 Sayeed_Mahdi D1 Jan. 8, 2026, 1:39 a.m. OK C++20 (GCC 13-64) TESTS 30 187 11673600
356894470 kollipara D1 Jan. 8, 2026, 2:55 a.m. OK C++20 (GCC 13-64) TESTS 30 187 16896000
356907837 Konjit D1 Jan. 8, 2026, 5:59 a.m. OK C++20 (GCC 13-64) TESTS 30 187 21299200
356895234 momosang D1 Jan. 8, 2026, 3:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 125 11366400
356903197 TempestMiku D1 Jan. 8, 2026, 5:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 140 18636800
356884461 GOTKAKO D1 Jan. 7, 2026, 9:54 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 171 16076800
356855677 wudidaniuma D1 Jan. 7, 2026, 5:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 171 25804800
356851132 AphelIO D1 Jan. 7, 2026, 4:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 171 47411200
356884296 adarsh_afk D1 Jan. 7, 2026, 9:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 187 6656000
356890224 Kita3 D1 Jan. 8, 2026, 1:19 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 187 7475200
356903587 Benq D1 Jan. 8, 2026, 5:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 187 8704000
356874887 Ippo_kun D1 Jan. 7, 2026, 7:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 187 8806400
356864315 Suuuper D1 Jan. 7, 2026, 5:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 187 8806400
356865857 Gassa D1 Jan. 7, 2026, 5:33 p.m. OK D TESTS 30 890 92979200
356877442 ruban D1 Jan. 7, 2026, 7:50 p.m. OK FPC TESTS 30 187 83763200
356858012 sorcha23 D1 Jan. 7, 2026, 5:10 p.m. OK GNU C11 TESTS 30 109 7168000
356850004 thenewbiecoder D1 Jan. 7, 2026, 4:48 p.m. OK GNU C11 TESTS 30 125 8089600
356888225 1435730 D1 Jan. 8, 2026, 12:05 a.m. OK GNU C11 TESTS 30 156 14643200
356859335 pengin_2000 D1 Jan. 7, 2026, 5:14 p.m. OK GNU C11 TESTS 30 671 17715200
356900187 __baozii__ D1 Jan. 8, 2026, 4:24 a.m. OK Go TESTS 30 140 26624000
356853392 yiren D1 Jan. 7, 2026, 4:57 p.m. OK Go TESTS 30 171 30003200
356876452 beatinghu D1 Jan. 7, 2026, 7:37 p.m. OK Java 21 TESTS 30 265 6860800
356854712 priyank_4_sure D1 Jan. 7, 2026, 5:01 p.m. OK Java 21 TESTS 30 406 6656000
356862900 RahulAhuja2901 D1 Jan. 7, 2026, 5:25 p.m. OK Java 21 TESTS 30 562 34713600
356857656 s1ij1n D1 Jan. 7, 2026, 5:09 p.m. OK Java 21 TESTS 30 578 123904000
356866392 GuLLu05 D1 Jan. 7, 2026, 5:34 p.m. OK Java 21 TESTS 30 750 61337600
356877477 .TheFugitive. D1 Jan. 7, 2026, 7:50 p.m. OK Java 21 TESTS 30 765 50892800
356888578 SoHxM2K D1 Jan. 8, 2026, 12:19 a.m. OK Java 21 TESTS 30 765 67481600
356905952 man-ray D1 Jan. 8, 2026, 5:37 a.m. OK Java 21 TESTS 30 765 128102400
356874226 creatineMonohydrate D1 Jan. 7, 2026, 7:14 p.m. OK Java 21 TESTS 30 781 35635200
356862903 pranjulsaxena682 D1 Jan. 7, 2026, 5:25 p.m. OK Java 21 TESTS 30 781 36249600
356859263 kamranm D1 Jan. 7, 2026, 5:14 p.m. OK Java 8 TESTS 30 515 222924800
356900165 kevin_0911 D1 Jan. 8, 2026, 4:23 a.m. OK Java 8 TESTS 30 609 47206400
356852689 Durgesh_codeforces_cs23 D1 Jan. 7, 2026, 4:55 p.m. OK Java 8 TESTS 30 656 29900800
356861937 abhi... D1 Jan. 7, 2026, 5:22 p.m. OK Java 8 TESTS 30 1328 27955200
356850088 syed_raza D1 Jan. 7, 2026, 4:48 p.m. OK Java 8 TESTS 30 1359 31334400
356881279 TriptiChaurasia D1 Jan. 7, 2026, 8:48 p.m. OK Java 8 TESTS 30 1390 31232000
356853799 teena59537 D1 Jan. 7, 2026, 4:58 p.m. OK Java 8 TESTS 30 1421 31232000
356850292 teena53597 D1 Jan. 7, 2026, 4:48 p.m. OK Java 8 TESTS 30 1453 45363200
356865946 abbasslb D1 Jan. 7, 2026, 5:33 p.m. OK Java 8 TESTS 30 1453 65536000
356852297 vanishamittal1409 D1 Jan. 7, 2026, 4:54 p.m. OK Java 8 TESTS 30 1671 61337600
356860454 Dear_Luca D1 Jan. 7, 2026, 5:18 p.m. OK PyPy 3 TESTS 30 546 21811200
356852883 MihailLoginov D1 Jan. 7, 2026, 4:56 p.m. OK PyPy 3 TESTS 30 1281 33792000
356856323 _nikita03 D1 Jan. 7, 2026, 5:06 p.m. OK PyPy 3 TESTS 30 1281 34406400
356895081 ansere D1 Jan. 8, 2026, 3:05 a.m. OK PyPy 3-64 TESTS 30 375 62054400
356908062 ihtuyd D1 Jan. 8, 2026, 6:01 a.m. OK PyPy 3-64 TESTS 30 453 40448000
356863124 Arman_rbu D1 Jan. 7, 2026, 5:26 p.m. OK PyPy 3-64 TESTS 30 453 469094400
356856211 davlatovzikriolloh85 D1 Jan. 7, 2026, 5:05 p.m. OK PyPy 3-64 TESTS 30 484 40243200
356883533 Mustela_Erminea D1 Jan. 7, 2026, 9:33 p.m. OK PyPy 3-64 TESTS 30 484 52019200
356855183 Sumant_64 D1 Jan. 7, 2026, 5:02 p.m. OK PyPy 3-64 TESTS 30 484 52736000
356892168 Little_Sheep_Yawn D1 Jan. 8, 2026, 2:09 a.m. OK PyPy 3-64 TESTS 30 484 54476800
356856024 Takanashi_Rikka D1 Jan. 7, 2026, 5:05 p.m. OK PyPy 3-64 TESTS 30 500 40448000
356851944 Reddi-twelve D1 Jan. 7, 2026, 4:53 p.m. OK PyPy 3-64 TESTS 30 500 46080000
356858997 SebasMusk D1 Jan. 7, 2026, 5:13 p.m. OK PyPy 3-64 TESTS 30 500 54476800
356865380 tah23seen D1 Jan. 7, 2026, 5:32 p.m. OK Python 3 TESTS 30 531 70553600
356850991 _SPARKY_2710 D1 Jan. 7, 2026, 4:50 p.m. OK Python 3 TESTS 30 562 45977600
356857098 davidmiheev D1 Jan. 7, 2026, 5:08 p.m. OK Python 3 TESTS 30 593 55500800
356856989 noir123 D1 Jan. 7, 2026, 5:07 p.m. OK Python 3 TESTS 30 640 40345600
356852536 kit27.ad15 D1 Jan. 7, 2026, 4:55 p.m. OK Python 3 TESTS 30 734 57958400
356866031 Cheesies D1 Jan. 7, 2026, 5:33 p.m. OK Python 3 TESTS 30 796 69120000
356858010 twngzxc D1 Jan. 7, 2026, 5:10 p.m. OK Python 3 TESTS 30 796 74752000
356861979 mxq D1 Jan. 7, 2026, 5:22 p.m. OK Python 3 TESTS 30 812 71680000
356858333 FerryMan27 D1 Jan. 7, 2026, 5:11 p.m. OK Python 3 TESTS 30 875 38809600
356854429 OmgKawaiiAngel D1 Jan. 7, 2026, 5 p.m. OK Python 3 TESTS 30 890 46899200
356892866 NKS01X D1 Jan. 8, 2026, 2:24 a.m. OK Rust 2024 TESTS 30 125 23961600
356863757 varunnn_gupta D1 Jan. 7, 2026, 5:28 p.m. OK Rust 2024 TESTS 30 156 51916800
356857314 despair D1 Jan. 7, 2026, 5:08 p.m. OK Rust 2024 TESTS 30 187 48947200

remove filters

Back to search problems