Codeforces Round 1090 (Div. 4)

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
2218 Codeforces Round 1090 (Div. 4) FINISHED False 8100 5066687 April 4, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8225 ) F The 67th Tree Problem PROGRAMMING constructive algorithms implementation trees

Now that PMOI season is over (Cloud emerged victorious), Macaque can continue on his journey towards enlightenment. The problems he is to solve are getting harder, the burden of the past lives is getting heavier, and you are losing your free will at such a rate that you struggle to remember the last time you did anything out of your own volition without being coerced by Macaque. The only upside for you is that Macaque is giving you a free tour of his current habitat up in the trees once you solve the following problem for him. You are given two integers (x) and (y). Your task is to construct a tree with (x + y) nodes, rooted at node (1), such that: Exactly (x) nodes in the tree have even subtree(^{\text{∗}}) size. Exactly (y) nodes in the tree have odd subtree size. (^{\text{∗}})The subtree of a vertex (u) is the set of all vertices that pass through (u) on a simple path to the root (including (u) itself). 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. Each subsequent line contains two integers (x) and (y) ((0 \leq x, y \leq 2 \cdot 10^5), (1 \leq x + y \leq 2 \cdot 10^5)). It is guaranteed that the sum of (x+y) over all test cases does not exceed (2\cdot 10^5). For each query, output " YES " or " NO ", depending on whether or not a construction exists. You can output " YES " and " NO " in any case (for example, " yES ", " yes ", and " Yes " will be recognized as a positive response). If you output " YES ", output (x+y-1) lines, each containing two space-separated integers (u) and (v), denoting that there is an edge between nodes (u) and (v). In the first test, the output tree is valid because node (1) has subtree size (2), which is even, and node (2) has subtree size (1), which is odd. In the second test, it can be shown that no valid t

Tutorials

Codeforces Round 1090 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
369815724 Subhash_7_4 F April 5, 2026, 4:20 a.m. OK C++17 (GCC 7-32) TESTS 10 31 102400
369816616 NotLosingHope F April 5, 2026, 4:37 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
369808992 niwrad F April 5, 2026, 2 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
369808573 Couristacitve F April 5, 2026, 1:50 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
369776956 VivekAnand F April 4, 2026, 5:35 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
369772409 Saiful_Islam F April 4, 2026, 5:04 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
369768936 snehamishra132003 F April 4, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
369819340 Aranaya F April 5, 2026, 5:16 a.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
369814723 Kitty_Cat.0702 F April 5, 2026, 4:02 a.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
369814335 not_tle F April 5, 2026, 3:54 a.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
369818307 ikeaError F April 5, 2026, 5:03 a.m. OK C++20 (GCC 13-64) TESTS 10 31 0
369785571 mistryman F April 4, 2026, 6:46 p.m. OK C++20 (GCC 13-64) TESTS 10 31 0
369776320 Ba4aaa_Albld F April 4, 2026, 5:30 p.m. OK C++20 (GCC 13-64) TESTS 10 31 0
369818872 AlRntn F April 5, 2026, 5:10 a.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
369818751 levi__k F April 5, 2026, 5:08 a.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
369810415 ubfStorage F April 5, 2026, 2:30 a.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
369771833 wangzc2024 F April 4, 2026, 5:01 p.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
369766970 Ruliks F April 4, 2026, 4:45 p.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
369775705 losttowin F April 4, 2026, 5:26 p.m. OK C++20 (GCC 13-64) TESTS 10 31 512000
369785294 Nika. F April 4, 2026, 6:44 p.m. OK C++20 (GCC 13-64) TESTS 10 31 1126400
369818342 SMH_2518 F April 5, 2026, 5:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369817322 Rukendo F April 5, 2026, 4:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369813405 kovid17 F April 5, 2026, 3:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369810134 exccc F April 5, 2026, 2:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369801098 Neoster4762 F April 4, 2026, 10:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369798898 MoulikGaba24 F April 4, 2026, 10:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369794864 Plavac52431 F April 4, 2026, 8:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369794664 woonder F April 4, 2026, 8:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369792220 KobeMamba F April 4, 2026, 8:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369781344 Qzxell F April 4, 2026, 6:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
369768581 frag_ F April 4, 2026, 4:48 p.m. OK GNU C11 TESTS 10 812 0
369807785 marcolai0103 F April 5, 2026, 1:33 a.m. OK GNU C11 TESTS 10 828 0
369798070 This_Is_Amazing F April 4, 2026, 9:48 p.m. OK Java 21 TESTS 10 218 716800
369775053 kartik__sethi F April 4, 2026, 5:21 p.m. OK Java 21 TESTS 10 234 4300800
369817010 shhh_knight30 F April 5, 2026, 4:44 a.m. OK Java 21 TESTS 10 265 1843200
369789051 dinddinddind F April 4, 2026, 7:25 p.m. OK Java 21 TESTS 10 281 819200
369767373 _l0Yashwanth0l_ F April 4, 2026, 4:46 p.m. OK Java 21 TESTS 10 281 1228800
369793154 yashtk_14 F April 4, 2026, 8:17 p.m. OK Java 21 TESTS 10 296 307200
369811813 jaysuryaray1998 F April 5, 2026, 3:05 a.m. OK Java 21 TESTS 10 312 716800
369767880 Pranel_Agrawal F April 4, 2026, 4:47 p.m. OK Java 21 TESTS 10 328 1331200
369775738 vignesh13022005 F April 4, 2026, 5:26 p.m. OK Java 21 TESTS 10 343 1945600
369785010 SIDH_777 F April 4, 2026, 6:41 p.m. OK Java 21 TESTS 10 343 2150400
369789008 Pranav_45 F April 4, 2026, 7:24 p.m. OK Java 8 TESTS 10 156 39014400
369786001 samamn_varshney F April 4, 2026, 6:51 p.m. OK Java 8 TESTS 10 218 0
369784080 TheJavaGuy F April 4, 2026, 6:33 p.m. OK Java 8 TESTS 10 390 0
369793976 SnowballSH F April 4, 2026, 8:30 p.m. OK Kotlin 2.2 TESTS 10 375 25190400
369767318 111vad111 F April 4, 2026, 4:46 p.m. OK PyPy 3 TESTS 10 375 10649600
369795267 Rainmaker2627 F April 4, 2026, 8:52 p.m. OK PyPy 3 TESTS 10 390 9420800
369778556 Arvind215271 F April 4, 2026, 5:48 p.m. OK PyPy 3 TESTS 10 406 12697600
369772730 omkaar F April 4, 2026, 5:06 p.m. OK PyPy 3-64 TESTS 10 109 9420800
369767470 Asterix22 F April 4, 2026, 4:46 p.m. OK PyPy 3-64 TESTS 10 125 8396800
369799077 nhtlongcs F April 4, 2026, 10:13 p.m. OK PyPy 3-64 TESTS 10 125 8806400
369770414 jjik F April 4, 2026, 4:53 p.m. OK PyPy 3-64 TESTS 10 140 8499200
369801938 D2009 F April 4, 2026, 11:06 p.m. OK PyPy 3-64 TESTS 10 140 16588800
369807942 ankan2526 F April 5, 2026, 1:37 a.m. OK PyPy 3-64 TESTS 10 140 21401600
369773130 TanJWcode F April 4, 2026, 5:09 p.m. OK PyPy 3-64 TESTS 10 156 9113600
369807212 revanth66 F April 5, 2026, 1:19 a.m. OK PyPy 3-64 TESTS 10 156 9318400
369782191 999plus F April 4, 2026, 6:17 p.m. OK PyPy 3-64 TESTS 10 156 9420800
369800211 ep268gza F April 4, 2026, 10:31 p.m. OK PyPy 3-64 TESTS 10 156 9625600
369770277 Sakurajima_Mai_yx F April 4, 2026, 4:53 p.m. OK Python 3 TESTS 10 93 20582400
369771801 lingxiao00294 F April 4, 2026, 5:01 p.m. OK Python 3 TESTS 10 109 23244800
369770787 lingxiao00294 F April 4, 2026, 4:55 p.m. OK Python 3 TESTS 10 125 22630400
369770896 lingxiao00294 F April 4, 2026, 4:56 p.m. OK Python 3 TESTS 10 140 19148800
369811247 amagant01 F April 5, 2026, 2:52 a.m. OK Python 3 TESTS 10 140 23961600
369768927 diwakarm0507 F April 4, 2026, 4:49 p.m. OK Python 3 TESTS 10 156 21504000
369768515 lingxiao00294 F April 4, 2026, 4:48 p.m. OK Python 3 TESTS 10 250 512000
369789566 rmkaaaa F April 4, 2026, 7:31 p.m. OK Python 3 TESTS 10 359 409600
369768354 MythiCODE F April 4, 2026, 4:48 p.m. OK Python 3 TESTS 10 390 307200
369767662 Barom4k F April 4, 2026, 4:46 p.m. OK Python 3 TESTS 10 390 307200
369768774 viniciusth F April 4, 2026, 4:48 p.m. OK Rust 2024 TESTS 10 46 11776000

remove filters

Back to search problems