Codeforces Round 881 (Div. 3)

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
1843 Codeforces Round 881 (Div. 3) FINISHED False 8100 49994663 June 20, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18684 ) D Apple Tree PROGRAMMING combinatorics dfs and similar dp trees

B"Timofey has an apple tree growing in his garden; it is a rooted tree of n vertices with the root in vertex 1 (the vertices are numbered from 1 to n ). A tree is a connected graph without loops and multiple edges. This tree is very unusual -- it grows with its root upwards. However, it's quite normal for programmer's trees. The apple tree is quite young, so only two apples will grow on it. Apples will grow in certain vertices (these vertices may be the same). After the apples grow, Timofey starts shaking the apple tree until the apples fall. Each time Timofey shakes the apple tree, the following happens to each of the apples: Let the apple now be at vertex u . It can be shown that after a finite time, both apples will fall from the tree. Timofey has q assumptions in which vertices apples can grow. He assumes that apples can grow in vertices x and y , and wants to know the number of pairs of vertices ( a , b ) from which apples can fall from the tree, where a -- the vertex from which an apple from vertex x will fall, b -- the vertex from which an apple from vertex y will fall. Help him do this. The first line contains integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The first line of each test case contains integer n ( 2 <= q n <= q 2 cdot 10^5 ) -- the number of vertices in the tree. Then there are n - 1 lines describing the tree. In line i there are two integers u_i and v_i ( 1 <= q u_i, v_i <= q n , u_i ne v_i ) -- edge in tree. The next line contains a single integer q ( 1 <= q q <= q 2 cdot 10^5 ) -- the number of Timofey's assumptions. Each of the next q lines contains two integers x_i and y_i ( 1 <= q x_i, y_i <= q n ) -- the supposed vertices on which the apples will grow for the assumption i . It is guaranteed that the sum of n does not exceed "...

Tutorials

Codeforces Round #881 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
210498519 chrisTris D June 21, 2023, 2:53 a.m. OK C# 10 TESTS 29 685 77209600
210495816 bluemegane D June 21, 2023, 1:56 a.m. OK C# 8 TESTS 29 421 49971200
210495681 bluemegane D June 21, 2023, 1:53 a.m. OK C# 8 TESTS 29 1387 48332800
210544848 __IZAZ__ D June 21, 2023, 12:26 p.m. OK Clang++17 Diagnostics TESTS 30 951 81305600
210503503 qiqi_1 D June 21, 2023, 4:26 a.m. OK GNU C11 TESTS 29 904 11161600
210503032 qiqi_1 D June 21, 2023, 4:17 a.m. OK GNU C11 TESTS 29 904 14438400
210503122 qiqi_1 D June 21, 2023, 4:19 a.m. OK GNU C11 TESTS 29 920 14438400
210506559 zhengjunxi D June 21, 2023, 5:21 a.m. OK GNU C++14 TESTS 29 202 7270400
210610071 Mr_White_ D June 22, 2023, 2:51 a.m. OK GNU C++14 TESTS 31 202 13209600
210618276 Je3ter D June 22, 2023, 5:12 a.m. OK GNU C++14 TESTS 31 202 16179200
210544800 __IZAZ__ D June 21, 2023, 12:26 p.m. OK GNU C++14 TESTS 30 202 16179200
210619569 Anumoy_nandy D June 22, 2023, 5:34 a.m. OK GNU C++14 TESTS 31 202 23756800
210557805 HighLights D June 21, 2023, 2:27 p.m. OK GNU C++14 TESTS 31 217 16179200
210527674 xiecarr D June 21, 2023, 9:33 a.m. OK GNU C++14 TESTS 30 217 16998400
210538893 dhruv1807 D June 21, 2023, 11:28 a.m. OK GNU C++14 TESTS 30 217 16998400
210500366 KanPard005 D June 21, 2023, 3:28 a.m. OK GNU C++14 TESTS 29 217 19456000
210516355 shohagfaraji D June 21, 2023, 7:43 a.m. OK GNU C++14 TESTS 30 218 16179200
210599876 value0 D June 21, 2023, 11:15 p.m. OK GNU C++17 TESTS 31 171 16793600
210524129 NothingAtall D June 21, 2023, 8:59 a.m. OK GNU C++17 TESTS 30 187 15974400
210593489 Amandeep_2624 D June 21, 2023, 9:18 p.m. OK GNU C++17 TESTS 31 202 10854400
210605782 Longqiang D June 22, 2023, 1:28 a.m. OK GNU C++17 TESTS 31 202 11571200
210506058 jackedCODER D June 21, 2023, 5:13 a.m. OK GNU C++17 TESTS 29 202 16179200
210495108 ZXG_DZXX D June 21, 2023, 1:38 a.m. OK GNU C++17 TESTS 29 202 16179200
210595519 Muhammad_Alparslan D June 21, 2023, 9:52 p.m. OK GNU C++17 TESTS 31 202 16179200
210514946 var4yn D June 21, 2023, 7:27 a.m. OK GNU C++17 TESTS 29 202 19353600
210505955 chakradhar94 D June 21, 2023, 5:11 a.m. OK GNU C++17 TESTS 29 202 19353600
210550668 Gentor600 D June 21, 2023, 1:21 p.m. OK GNU C++17 TESTS 30 202 20172800
210567442 Newbie_QQH D June 21, 2023, 4 p.m. OK GNU C++17 (64) TESTS 31 155 35225600
210546965 yrtrt D June 21, 2023, 12:47 p.m. OK GNU C++17 (64) TESTS 30 155 50483200
210495125 MrXavier D June 21, 2023, 1:39 a.m. OK GNU C++17 (64) TESTS 29 171 32051200
210539484 Krzychuo D June 21, 2023, 11:34 a.m. OK GNU C++17 (64) TESTS 30 186 28057600
210553762 PurpleCJ D June 21, 2023, 1:51 p.m. OK GNU C++17 (64) TESTS 31 186 32051200
210501697 Yuudachihouteishiki D June 21, 2023, 3:53 a.m. OK GNU C++17 (64) TESTS 29 186 37683200
210608818 cwxcai D June 22, 2023, 2:27 a.m. OK GNU C++17 (64) TESTS 31 187 34508800
210607579 ace055 D June 22, 2023, 2:04 a.m. OK GNU C++17 (64) TESTS 31 187 37683200
210610804 mushanyu D June 22, 2023, 3:05 a.m. OK GNU C++17 (64) TESTS 31 187 45158400
210604005 Don D June 22, 2023, 12:50 a.m. OK GNU C++17 (64) TESTS 31 202 28057600
210494138 kiddy_z D June 21, 2023, 1:15 a.m. OK GNU C++20 (64) TESTS 29 109 11161600
210560676 Fiatiustitia D June 21, 2023, 2:55 p.m. OK GNU C++20 (64) TESTS 31 124 24064000
210550616 Dechancer D June 21, 2023, 1:21 p.m. OK GNU C++20 (64) TESTS 30 124 30412800
210497166 NightButterfly D June 21, 2023, 2:25 a.m. OK GNU C++20 (64) TESTS 29 140 18841600
210493549 zxzzxv D June 21, 2023, 12:56 a.m. OK GNU C++20 (64) TESTS 29 140 20070400
210493561 ricaxov D June 21, 2023, 12:56 a.m. OK GNU C++20 (64) TESTS 29 140 20070400
210566999 shobonvip D June 21, 2023, 3:55 p.m. OK GNU C++20 (64) TESTS 31 155 13926400
210519772 secretman1312 D June 21, 2023, 8:18 a.m. OK GNU C++20 (64) TESTS 30 155 17408000
210558845 Satinii D June 21, 2023, 2:37 p.m. OK GNU C++20 (64) TESTS 31 155 18841600
210538340 titan23 D June 21, 2023, 11:22 a.m. OK GNU C++20 (64) TESTS 30 155 20377600
210495101 cill D June 21, 2023, 1:38 a.m. OK Go TESTS 29 343 49356800
210495188 cill D June 21, 2023, 1:40 a.m. OK Go TESTS 29 373 48947200
210495150 cill D June 21, 2023, 1:39 a.m. OK Go TESTS 29 405 48947200
210563923 lordvidex D June 21, 2023, 3:26 p.m. OK Go TESTS 31 935 95129600
210612504 Raindrops1117 D June 22, 2023, 3:36 a.m. OK Go TESTS 31 951 83148800
210497846 lpychemistry D June 21, 2023, 2:40 a.m. OK Java 11 TESTS 29 436 56217600
210537866 q2045891621. D June 21, 2023, 11:18 a.m. OK Java 11 TESTS 30 607 46489600
210586103 themadknight45 D June 21, 2023, 7:39 p.m. OK Java 11 TESTS 31 670 50892800
210602903 new2ac D June 22, 2023, 12:25 a.m. OK Java 11 TESTS 31 1169 98713600
210531143 thenikhilkakarla D June 21, 2023, 10:05 a.m. OK Java 11 TESTS 30 1856 49561600
210499995 gauravvv2204 D June 21, 2023, 3:21 a.m. OK Java 11 TESTS 29 1933 170598400
210533377 md_shamim_ahmmed D June 21, 2023, 10:30 a.m. OK Java 11 TESTS 30 1949 97792000
210534563 ak363255 D June 21, 2023, 10:43 a.m. OK Java 11 TESTS 30 1996 134451200
210516048 jineshpatel_1103 D June 21, 2023, 7:40 a.m. OK Java 11 TESTS 29 1996 176025600
210516629 Lightars D June 21, 2023, 7:46 a.m. OK Java 11 TESTS 30 2464 134348800
210537061 soumit915 D June 21, 2023, 11:09 a.m. OK Java 17 TESTS 30 561 88473600
210495485 one_line D June 21, 2023, 1:48 a.m. OK Java 17 TESTS 29 670 59801600
210505947 wdjuruo D June 21, 2023, 5:11 a.m. OK Java 17 TESTS 29 685 58880000
210587978 Danger_Don D June 21, 2023, 8:04 p.m. OK Java 17 TESTS 31 717 99737600
210617941 cpp10 D June 22, 2023, 5:07 a.m. OK Java 17 TESTS 31 826 133734400
210617998 cpp10 D June 22, 2023, 5:07 a.m. OK Java 17 TESTS 31 857 133427200
210513789 Asnkkzk D June 21, 2023, 7:16 a.m. OK Java 17 TESTS 29 1216 78540800
210503325 AKhacks D June 21, 2023, 4:22 a.m. OK Java 17 TESTS 29 1247 77004800
210525509 coder_vishnu D June 21, 2023, 9:12 a.m. OK Java 17 TESTS 30 1278 68198400
210535255 v_0403 D June 21, 2023, 10:51 a.m. OK Java 17 TESTS 30 1980 55603200
210498926 chuquwan9964 D June 21, 2023, 3 a.m. OK Java 8 TESTS 29 436 67993600
210500629 magic_kid D June 21, 2023, 3:33 a.m. OK Java 8 TESTS 29 514 41676800
210608280 Monkey_de_Luffy D June 22, 2023, 2:17 a.m. OK Java 8 TESTS 31 529 49766400
210497608 Ahmad_Hoseiny D June 21, 2023, 2:35 a.m. OK Java 8 TESTS 29 608 53964800
210562706 Imran435 D June 21, 2023, 3:14 p.m. OK Java 8 TESTS 31 670 35737600
210553351 prakhar_30 D June 21, 2023, 1:47 p.m. OK Java 8 TESTS 31 717 121651200
210544304 Juhaied_nabid D June 21, 2023, 12:21 p.m. OK Java 8 TESTS 30 1481 51200000
210578327 ScoobyDoobyDo D June 21, 2023, 5:55 p.m. OK Java 8 TESTS 31 1590 65740800
210536745 klsane04 D June 21, 2023, 11:06 a.m. OK Java 8 TESTS 30 3697 47206400
210588276 Abhinav__hadole D June 21, 2023, 8:08 p.m. OK Java 8 TESTS 31 3853 51916800
210537416 hartiksalaria D June 21, 2023, 11:13 a.m. OK Kotlin 1.6 TESTS 30 608 50892800
210542056 linxiaotian D June 21, 2023, noon OK Kotlin 1.6 TESTS 30 795 74342400
210515062 Galina_Basalova D June 21, 2023, 7:28 a.m. OK MS C++ 2017 TESTS 29 748 12800000
210506536 exilesome D June 21, 2023, 5:20 a.m. OK MS C++ 2017 TESTS 29 1450 12902400
210506580 exilesome D June 21, 2023, 5:21 a.m. OK MS C++ 2017 TESTS 29 1465 12902400
210524113 l0oper D June 21, 2023, 8:58 a.m. OK MS C++ 2017 TESTS 30 3493 12288000
210522076 l0oper D June 21, 2023, 8:40 a.m. OK MS C++ 2017 TESTS 30 3837 12288000
210619108 EdhiMahbub21 D June 22, 2023, 5:26 a.m. OK PHP TESTS 31 919 180736000
210557797 zronghui D June 21, 2023, 2:27 p.m. OK PyPy 3 TESTS 31 1107 67993600
210533478 l0stempl3 D June 21, 2023, 10:31 a.m. OK PyPy 3-64 TESTS 30 420 76595200
210530133 Prith.wii D June 21, 2023, 9:56 a.m. OK PyPy 3-64 TESTS 30 452 65843200
210531433 Prith.wii D June 21, 2023, 10:08 a.m. OK PyPy 3-64 TESTS 30 499 56320000
210619968 Fighoh D June 22, 2023, 5:40 a.m. OK PyPy 3-64 TESTS 31 592 133324800
210507628 linhua D June 21, 2023, 5:38 a.m. OK PyPy 3-64 TESTS 29 623 51814400
210588930 rmr D June 21, 2023, 8:16 p.m. OK PyPy 3-64 TESTS 31 623 91033600
210566051 reijnnn D June 21, 2023, 3:46 p.m. OK PyPy 3-64 TESTS 31 639 61849600
210619722 Fighoh D June 22, 2023, 5:37 a.m. OK PyPy 3-64 TESTS 31 670 141209600
210603622 cybsbbb D June 22, 2023, 12:42 a.m. OK PyPy 3-64 TESTS 31 670 355328000
210550575 Titan_4 D June 21, 2023, 1:20 p.m. OK PyPy 3-64 TESTS 30 686 71987200
210502163 mxDawdle D June 21, 2023, 4:02 a.m. OK Python 3 TESTS 29 1091 43622400
210545406 Hajmola D June 21, 2023, 12:32 p.m. OK Python 3 TESTS 30 1122 345907200
210528847 nabovtl D June 21, 2023, 9:44 a.m. OK Python 3 TESTS 30 1123 417894400
210545509 Hajmola D June 21, 2023, 12:33 p.m. OK Python 3 TESTS 30 1138 346316800
210549791 sami02jain D June 21, 2023, 1:12 p.m. OK Python 3 TESTS 30 1262 358912000
210496333 wzl722 D June 21, 2023, 2:08 a.m. OK Python 3 TESTS 29 1357 358707200
210578199 Lotrick D June 21, 2023, 5:53 p.m. OK Python 3 TESTS 31 1419 62361600
210619804 Fighoh D June 22, 2023, 5:38 a.m. OK Python 3 TESTS 31 1794 180326400
210576824 khan_ali D June 21, 2023, 5:38 p.m. OK Python 3 TESTS 31 1965 65433600
210556105 ji-li-k D June 21, 2023, 2:13 p.m. OK Python 3 TESTS 31 2152 54374400
210539293 Stan_Marsh Kenny__McCormick Thief_Executive_Officer D June 21, 2023, 11:32 a.m. OK Rust 2021 TESTS 30 1824 35225600

remove filters

Back to search problems