Codeforces Round 909 (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
1899 Codeforces Round 909 (Div. 3) FINISHED False 8100 36948263 Nov. 17, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8062 ) F Alex's whims PROGRAMMING constructive algorithms graphs shortest paths trees

B"Tree is a connected graph without cycles. It can be shown that any tree of n vertices has exactly n - 1 edges. Leaf is a vertex in the tree with exactly one edge connected to it. Distance between two vertices u and v in a tree is the minimum number of edges that must be passed to come from vertex u to vertex v . Alex's birthday is coming up, and Timofey would like to gift him a tree of n vertices. However, Alex is a very moody boy. Every day for q days, he will choose an integer, denoted by the integer chosen on the i -th day by d_i . If on the i -th day there are not two leaves in the tree at a distance exactly d_i , Alex will be disappointed. Timofey decides to gift Alex a designer so that he can change his tree as he wants. Timofey knows that Alex is also lazy (a disaster, not a human being), so at the beginning of every day, he can perform no more than one operation of the following kind: Somehow Timofey managed to find out all the d_i . After that, he had another brilliant idea -- just in case, make an instruction manual for the set, one that Alex wouldn't be disappointed. Timofey is not as lazy as Alex, but when he saw the integer n , he quickly lost the desire to develop the instruction and the original tree, so he assigned this task to you. It can be shown that a tree and a sequence of operations satisfying the described conditions always exist. Here is an example of an operation where vertices were selected: u -- 6 , v_1 -- 1 , v_2 -- 4 . The first line contains the integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The first line of each test case contains two integers n ( 3 <= q n <= q 500 ) and q ( 1 <= q q <= q 500 ) -- the number of nodes in the tree and the number of days, respectively. The i th of the following q lines contains the integer d_i ( 2 <= q d_i <= q "...

Tutorials

Разбор Codeforces Round 909 (Div. 3)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
233228139 Gassa F Nov. 17, 2023, 10:58 p.m. OK D TESTS 6 15 204800
233227837 Gassa F Nov. 17, 2023, 10:49 p.m. OK D TESTS 6 30 204800
233228056 Gassa F Nov. 17, 2023, 10:56 p.m. OK D TESTS 6 31 204800
233246117 swayingdream F Nov. 18, 2023, 5:14 a.m. OK GNU C11 TESTS 6 15 0
233242795 H_ZzZ F Nov. 18, 2023, 4:32 a.m. OK GNU C++14 TESTS 6 0 0
233245386 Youzhencai F Nov. 18, 2023, 5:05 a.m. OK GNU C++14 TESTS 6 0 0
233239111 cyan_cloud F Nov. 18, 2023, 3:35 a.m. OK GNU C++14 TESTS 6 0 0
233234998 wendyasif F Nov. 18, 2023, 2:24 a.m. OK GNU C++14 TESTS 6 0 0
233227923 atomze78 F Nov. 17, 2023, 10:52 p.m. OK GNU C++14 TESTS 6 0 0
233218073 Pranjal_Singh_1702 F Nov. 17, 2023, 7:51 p.m. OK GNU C++14 TESTS 6 0 0
233215871 newone2023 F Nov. 17, 2023, 7:24 p.m. OK GNU C++14 TESTS 6 0 0
233193532 itsmeutpalraj9891 F Nov. 17, 2023, 4:47 p.m. OK GNU C++14 TESTS 6 0 0
233244742 Youzhencai F Nov. 18, 2023, 4:58 a.m. OK GNU C++14 TESTS 6 0 0
233248988 fairyduck F Nov. 18, 2023, 5:45 a.m. OK GNU C++14 TESTS 6 0 0
233247017 gokuu007 F Nov. 18, 2023, 5:23 a.m. OK GNU C++17 TESTS 6 0 0
233245782 fernandezpalomojosue F Nov. 18, 2023, 5:10 a.m. OK GNU C++17 TESTS 6 0 0
233245609 md_nihal F Nov. 18, 2023, 5:08 a.m. OK GNU C++17 TESTS 6 0 0
233243725 Havoc. F Nov. 18, 2023, 4:45 a.m. OK GNU C++17 TESTS 6 0 0
233243633 mobius-p F Nov. 18, 2023, 4:44 a.m. OK GNU C++17 TESTS 6 0 0
233243166 harsh_1806 F Nov. 18, 2023, 4:37 a.m. OK GNU C++17 TESTS 6 0 0
233241878 911Boom F Nov. 18, 2023, 4:19 a.m. OK GNU C++17 TESTS 6 0 0
233241839 Arcsaber200 F Nov. 18, 2023, 4:18 a.m. OK GNU C++17 TESTS 6 0 0
233241605 rahulk736694 F Nov. 18, 2023, 4:15 a.m. OK GNU C++17 TESTS 6 0 0
233248761 yujianlin1 F Nov. 18, 2023, 5:42 a.m. OK GNU C++17 TESTS 6 0 0
233237088 Vegetog F Nov. 18, 2023, 3:02 a.m. OK GNU C++17 (64) TESTS 6 0 0
233234242 fs20091003 F Nov. 18, 2023, 2:08 a.m. OK GNU C++17 (64) TESTS 6 0 0
233227017 rock_lock F Nov. 17, 2023, 10:28 p.m. OK GNU C++17 (64) TESTS 6 0 0
233213321 Liudas F Nov. 17, 2023, 6:55 p.m. OK GNU C++17 (64) TESTS 6 0 0
233204288 Dog_E F Nov. 17, 2023, 5:36 p.m. OK GNU C++17 (64) TESTS 6 0 0
233203856 Askiatic F Nov. 17, 2023, 5:33 p.m. OK GNU C++17 (64) TESTS 6 0 0
233203253 MUNISJONI_KHURSHEDJON F Nov. 17, 2023, 5:29 p.m. OK GNU C++17 (64) TESTS 6 0 0
233203012 AbduLL0 F Nov. 17, 2023, 5:27 p.m. OK GNU C++17 (64) TESTS 6 0 0
233199704 ILabelI F Nov. 17, 2023, 5:08 p.m. OK GNU C++17 (64) TESTS 6 0 0
233246721 chappy1 F Nov. 18, 2023, 5:20 a.m. OK GNU C++17 (64) TESTS 6 0 0
233246297 Winding. F Nov. 18, 2023, 5:16 a.m. OK GNU C++20 (64) TESTS 6 0 0
233250450 Fired F Nov. 18, 2023, 5:59 a.m. OK GNU C++20 (64) TESTS 6 0 0
233248220 Zzyzzx38 F Nov. 18, 2023, 5:36 a.m. OK GNU C++20 (64) TESTS 6 0 0
233247246 n1cknamezz F Nov. 18, 2023, 5:26 a.m. OK GNU C++20 (64) TESTS 6 0 0
233247091 butterChicken99 F Nov. 18, 2023, 5:24 a.m. OK GNU C++20 (64) TESTS 6 0 0
233246849 gourabh0911 F Nov. 18, 2023, 5:22 a.m. OK GNU C++20 (64) TESTS 6 0 0
233246819 Ashwini_Tiwari F Nov. 18, 2023, 5:21 a.m. OK GNU C++20 (64) TESTS 6 0 0
233246214 040328 F Nov. 18, 2023, 5:15 a.m. OK GNU C++20 (64) TESTS 6 0 0
233245209 sabbir772002 F Nov. 18, 2023, 5:03 a.m. OK GNU C++20 (64) TESTS 6 0 0
233244678 ishraqfatin7 F Nov. 18, 2023, 4:57 a.m. OK GNU C++20 (64) TESTS 6 0 0
233193471 lorenzotinfena F Nov. 17, 2023, 4:47 p.m. OK Go TESTS 6 31 102400
233226723 RiceTofu F Nov. 17, 2023, 10:20 p.m. OK Java 11 TESTS 6 202 0
233193694 RahulAhuja2901 F Nov. 17, 2023, 4:47 p.m. OK Java 11 TESTS 6 218 0
233211400 kasiru_69 F Nov. 17, 2023, 6:35 p.m. OK Java 11 TESTS 6 233 0
233248199 kenkapo F Nov. 18, 2023, 5:36 a.m. OK Java 17 TESTS 6 202 204800
233199041 TopCloser F Nov. 17, 2023, 5:05 p.m. OK Java 17 TESTS 6 202 204800
233237147 Zhanzhe_Lee F Nov. 18, 2023, 3:03 a.m. OK Java 17 TESTS 6 202 409600
233213867 tiger3768 F Nov. 17, 2023, 7:01 p.m. OK Java 17 TESTS 6 202 409600
233205148 optimus1369 F Nov. 17, 2023, 5:43 p.m. OK Java 17 TESTS 6 202 512000
233246519 VIVEK_8877 F Nov. 18, 2023, 5:18 a.m. OK Java 17 TESTS 6 217 512000
233209975 daksh_02 F Nov. 17, 2023, 6:22 p.m. OK Java 17 TESTS 6 218 716800
233192967 frey4 F Nov. 17, 2023, 4:46 p.m. OK Java 21 TESTS 6 249 0
233198007 mohamedhassan_c F Nov. 17, 2023, 5 p.m. OK Java 8 TESTS 6 92 5734400
233201657 puriabhijit000 F Nov. 17, 2023, 5:19 p.m. OK Java 8 TESTS 6 93 0
233199500 MintCat F Nov. 17, 2023, 5:07 p.m. OK Java 8 TESTS 6 171 0
233192619 DreamKing F Nov. 17, 2023, 4:45 p.m. OK PyPy 3 TESTS 6 108 1945600
233193023 SoleProprietor F Nov. 17, 2023, 4:46 p.m. OK PyPy 3-64 TESTS 6 62 0
233192052 haroldgparker F Nov. 17, 2023, 4:44 p.m. OK PyPy 3-64 TESTS 6 62 1638400
233198852 gardengnome F Nov. 17, 2023, 5:04 p.m. OK PyPy 3-64 TESTS 6 62 4198400
233211768 Chifwin F Nov. 17, 2023, 6:39 p.m. OK PyPy 3-64 TESTS 6 77 0
233202235 YMSeah F Nov. 17, 2023, 5:22 p.m. OK PyPy 3-64 TESTS 6 77 1638400
233194202 monish.s F Nov. 17, 2023, 4:48 p.m. OK PyPy 3-64 TESTS 6 77 2355200
233193780 Samyak_15 F Nov. 17, 2023, 4:47 p.m. OK PyPy 3-64 TESTS 6 77 2560000
233202740 LeoG F Nov. 17, 2023, 5:25 p.m. OK PyPy 3-64 TESTS 6 77 3788800
233201346 LeoG F Nov. 17, 2023, 5:17 p.m. OK PyPy 3-64 TESTS 6 77 3788800
233217332 handleisinuse F Nov. 17, 2023, 7:42 p.m. OK PyPy 3-64 TESTS 6 77 4096000
233196453 tan001 F Nov. 17, 2023, 4:54 p.m. OK Python 3 TESTS 6 31 0
233192482 yoshicarvajal F Nov. 17, 2023, 4:45 p.m. OK Python 3 TESTS 6 31 0
233211484 adarshmohapatra10 F Nov. 17, 2023, 6:36 p.m. OK Python 3 TESTS 6 31 102400
233195367 onevadapavcoder F Nov. 17, 2023, 4:49 p.m. OK Python 3 TESTS 6 46 0
233192862 vindeshwariprasad F Nov. 17, 2023, 4:46 p.m. OK Python 3 TESTS 6 46 0
233192225 Zappricious F Nov. 17, 2023, 4:44 p.m. OK Python 3 TESTS 6 46 0
233247084 tamuraup_wa F Nov. 18, 2023, 5:24 a.m. OK Rust 2021 TESTS 6 0 0
233210033 OneSadKid F Nov. 17, 2023, 6:22 p.m. OK Rust 2021 TESTS 6 15 0
233210020 _a253 F Nov. 17, 2023, 6:22 p.m. OK Rust 2021 TESTS 6 15 0

remove filters

Back to search problems