Codeforces Round 900 (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
1878 Codeforces Round 900 (Div. 3) FINISHED False 8100 41441063 Sept. 26, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1236 ) G wxhtzdy ORO Tree PROGRAMMING binary search bitmasks data structures dfs and similar math trees

B"After (finally) qualifying for the IOI 2023, wxhtzdy was very happy, so he decided to do what most competitive programmers do: trying to guess the problems that will be on IOI. During this process, he accidentally made a problem, which he thought was really cool. You are given a tree (a connected acyclic graph) with n vertices and n-1 edges. Vertex i ( 1 <= i <= n ) has a value a_i . Lets' define g(u, v) as the bitwise or of the values of all vertices on the shortest path from u to v . For example, let's say that we want to calculate g(3, 4) , on the tree from the first test case in the example. On the path from 3 to 4 are vertices 3 , 1 , 4 . Then, g(3, 4) = a_3 | a_1 | a_4 (here, | represents the bitwise OR operation). Also, you are given q queries, and each query looks like this: You are given x and y . Let's consider all vertices z such that z is on the shortest path from x to y (inclusive). Lets define the niceness of a vertex z as the sum of the number of non-zero bits in g(x, z) and the number of non-zero bits in g(y, z) . You need to find the maximum niceness among all vertices z on the shortest path from x to y . Since his brain is really tired after solving an output only problem on SIO (he had to do it to qualify for the IOI), he wants your help with this problem. The first line of input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of vertices. The second line of each test case contains n positive integers a_1, a_2, ... , a_n ( 1 <= a_v <= 10^9 ) -- the value of each vertex, the i -th integer in this line corresponds to the vertex i . Following n - 1 lines are the description of a"...

Tutorials

Codeforces round #900 (Div.3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
225538251 mban259 G Sept. 27, 2023, 3:36 p.m. OK C# 10 TESTS 26 4180 204288000
225538322 mban259 G Sept. 27, 2023, 3:36 p.m. OK C# 10 TESTS 26 4196 204185600
225452352 xzf200906 G Sept. 27, 2023, 3:08 a.m. OK GNU C++14 TESTS 26 685 50073600
225451038 xzf200906 G Sept. 27, 2023, 2:45 a.m. OK GNU C++14 TESTS 26 702 50073600
225472151 xzf200906 G Sept. 27, 2023, 7:40 a.m. OK GNU C++14 TESTS 26 748 50073600
225482871 chenyanxi G Sept. 27, 2023, 9:06 a.m. OK GNU C++14 TESTS 26 779 70963200
225482427 chenyanxi G Sept. 27, 2023, 9:03 a.m. OK GNU C++14 TESTS 26 795 70963200
225593055 lk2147 G Sept. 28, 2023, 4:25 a.m. OK GNU C++14 TESTS 26 858 65843200
225483108 luogu_bot2 G Sept. 27, 2023, 9:08 a.m. OK GNU C++14 TESTS 26 872 70963200
225487780 jkljdsal G Sept. 27, 2023, 9:45 a.m. OK GNU C++14 TESTS 26 904 126054400
225487436 jkljdsal G Sept. 27, 2023, 9:42 a.m. OK GNU C++14 TESTS 26 935 126054400
225578667 omeganot G Sept. 27, 2023, 11:16 p.m. OK GNU C++14 TESTS 26 998 112742400
225538029 NMD2k6tg G Sept. 27, 2023, 3:34 p.m. OK GNU C++17 TESTS 26 654 110387200
225451438 Shehuinitiandie G Sept. 27, 2023, 2:52 a.m. OK GNU C++17 TESTS 26 655 50176000
225459060 egoist228 G Sept. 27, 2023, 4:42 a.m. OK GNU C++17 TESTS 26 670 50176000
225492381 peti1234 G Sept. 27, 2023, 10:24 a.m. OK GNU C++17 TESTS 26 748 95232000
225524749 OutsiderZz G Sept. 27, 2023, 2:01 p.m. OK GNU C++17 TESTS 26 1107 52326400
225566338 ELDRVD G Sept. 27, 2023, 7:41 p.m. OK GNU C++17 TESTS 26 1169 71475200
225486992 nicnaknic G Sept. 27, 2023, 9:38 a.m. OK GNU C++17 TESTS 26 1201 76390400
225485929 Once_I_Liked_AGirl G Sept. 27, 2023, 9:30 a.m. OK GNU C++17 TESTS 26 1262 53862400
225485798 Once_I_Liked_AGirl G Sept. 27, 2023, 9:29 a.m. OK GNU C++17 TESTS 26 1341 53862400
225550311 acidLemon G Sept. 27, 2023, 5:09 p.m. OK GNU C++17 TESTS 26 1341 118169600
225497000 hhh3 G Sept. 27, 2023, 11 a.m. OK GNU C++17 (64) TESTS 26 655 78131200
225452229 LXH-cat G Sept. 27, 2023, 3:06 a.m. OK GNU C++17 (64) TESTS 26 888 54988800
225528726 -14 G Sept. 27, 2023, 2:27 p.m. OK GNU C++17 (64) TESTS 26 936 101068800
225554312 John_zyj G Sept. 27, 2023, 5:44 p.m. OK GNU C++17 (64) TESTS 26 967 91340800
225529169 -14 G Sept. 27, 2023, 2:30 p.m. OK GNU C++17 (64) TESTS 26 1014 101068800
225531751 gqf123 G Sept. 27, 2023, 2:48 p.m. OK GNU C++17 (64) TESTS 26 1185 57753600
225480861 zzy__ G Sept. 27, 2023, 8:51 a.m. OK GNU C++17 (64) TESTS 26 1294 158515200
225527132 cjnwq G Sept. 27, 2023, 2:17 p.m. OK GNU C++17 (64) TESTS 26 1372 111308800
225450147 gqf123 G Sept. 27, 2023, 2:30 a.m. OK GNU C++17 (64) TESTS 26 1450 58982400
225599083 nanoblob G Sept. 28, 2023, 5:40 a.m. OK GNU C++17 (64) TESTS 26 1466 225075200
225590348 magnus.hegdahl G Sept. 28, 2023, 3:42 a.m. OK GNU C++20 (64) TESTS 26 264 75264000
225588992 milind0110 G Sept. 28, 2023, 3:16 a.m. OK GNU C++20 (64) TESTS 26 452 46387200
225588938 milind0110 G Sept. 28, 2023, 3:15 a.m. OK GNU C++20 (64) TESTS 26 499 45977600
225492192 Absurd_ G Sept. 27, 2023, 10:22 a.m. OK GNU C++20 (64) TESTS 26 514 135168000
225485096 qdhys G Sept. 27, 2023, 9:23 a.m. OK GNU C++20 (64) TESTS 26 623 90214400
225485270 qdhys G Sept. 27, 2023, 9:25 a.m. OK GNU C++20 (64) TESTS 26 639 90214400
225599129 YYYLLL2021 G Sept. 28, 2023, 5:40 a.m. OK GNU C++20 (64) TESTS 26 686 57958400
225452379 visitpage G Sept. 27, 2023, 3:08 a.m. OK GNU C++20 (64) TESTS 26 701 137932800
225482063 Lyde G Sept. 27, 2023, 9 a.m. OK GNU C++20 (64) TESTS 26 732 63795200
225573450 amirhozaifa G Sept. 27, 2023, 9:20 p.m. OK GNU C++20 (64) TESTS 26 732 133222400
225561998 cpp10 G Sept. 27, 2023, 6:54 p.m. OK Java 17 TESTS 26 3494 224460800
225562437 cpp10 G Sept. 27, 2023, 6:59 p.m. OK Java 17 TESTS 26 3572 224256000
225573709 dzhi G Sept. 27, 2023, 9:25 p.m. OK Java 17 TESTS 26 4632 146534400
225481954 Zhanzhe_Lee G Sept. 27, 2023, 8:59 a.m. OK Java 8 TESTS 26 1419 180428800
225487193 Zhanzhe_Lee G Sept. 27, 2023, 9:40 a.m. OK Java 8 TESTS 26 1512 180428800
225461235 yuki_keshiki G Sept. 27, 2023, 5:09 a.m. OK PyPy 3-64 TESTS 26 2355 206745600
225461350 yuki_keshiki G Sept. 27, 2023, 5:10 a.m. OK PyPy 3-64 TESTS 26 3587 224153600
225498140 SoleProprietor G Sept. 27, 2023, 11:08 a.m. OK PyPy 3-64 TESTS 26 4164 239411200
225459583 yuki_keshiki G Sept. 27, 2023, 4:49 a.m. OK PyPy 3-64 TESTS 26 4508 228966400
225522180 mikeac G Sept. 27, 2023, 1:44 p.m. OK PyPy 3-64 TESTS 26 4586 229068800
225472914 mkawa2 G Sept. 27, 2023, 7:49 a.m. OK PyPy 3-64 TESTS 26 4632 151040000
225489355 robostac G Sept. 27, 2023, 9:58 a.m. OK Rust 2021 TESTS 26 966 132812800
225496951 andrey.m G Sept. 27, 2023, 11 a.m. OK Rust 2021 TESTS 26 1216 222003200

remove filters

Back to search problems