Codeforces Round 700 (Div. 1)

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
1479 Codeforces Round 700 (Div. 1) FINISHED False 8100 124644311 Feb. 7, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1042 ) D Odd Mineral Resource PROGRAMMING bitmasks data structures hashing probabilities trees

B"In Homer's country, there are n cities numbered 1 to n and they form a tree. That is, there are (n-1) undirected roads between these n cities and every two cities can reach each other through these roads. Homer's country is an industrial country, and each of the n cities in it contains some mineral resource. The mineral resource of city i is labeled a_i . Homer is given the plans of the country in the following q years. The plan of the i -th year is described by four parameters u_i, v_i, l_i and r_i , and he is asked to find any mineral resource c_i such that the following two conditions hold: As the best friend of Homer, he asks you for help. For every plan, find any such mineral resource c_i , or tell him that there doesn't exist one. The first line contains two integers n ( 1 <= q n <= q 3 cdot 10^5 ) and q ( 1 <= q q <= q 3 cdot 10^5 ), indicating the number of cities and the number of plans. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q n ). Then the i -th line of the following (n-1) lines contains two integers x_i and y_i ( 1 <= q x_i, y_i <= q n ) with x_i neq y_i , indicating that there is a bidirectional road between city x_i and city y_i . It is guaranteed that the given roads form a tree. Then the i -th line of the following q lines contains four integers u_i , v_i , l_i , r_i ( 1 <= q u_i <= q n , 1 <= q v_i <= q n , 1 <= q l_i <= q r_i <= q n ), indicating the plan of the i -th year. Print q lines, the i -th of which contains an integer c_i such that In the first three queries, there are four cities between city 3 and city 5 , which are city 1 , city 2 , city 3 and city 5 . The mineral resources appear in them are mineral resources 1 (appears in ci"...

Tutorials

Editorial of Codeforces Round #700

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
106871677 interlude D Feb. 8, 2021, 4:21 a.m. OK GNU C++11 TESTS 51 623 313344000
106864844 dqa2021 D Feb. 8, 2021, 2:07 a.m. OK GNU C++11 TESTS 51 732 163532800
106867641 AquaMoon D Feb. 8, 2021, 3:09 a.m. OK GNU C++11 TESTS 51 888 270028800
106867625 AquaMoon D Feb. 8, 2021, 3:09 a.m. OK GNU C++11 TESTS 51 904 270028800
106830544 Flying2018 D Feb. 7, 2021, 4:29 p.m. OK GNU C++11 TESTS 51 904 393113600
106869133 ButterCake D Feb. 8, 2021, 3:36 a.m. OK GNU C++11 TESTS 51 1216 269312000
106812254 Hs-Black D Feb. 7, 2021, 3:58 p.m. OK GNU C++11 TESTS 51 1294 373248000
106837432 skydogli D Feb. 7, 2021, 4:42 p.m. OK GNU C++11 TESTS 51 1341 337817600
106797025 Clix D Feb. 7, 2021, 3:35 p.m. OK GNU C++11 TESTS 51 1497 251289600
106865975 hellomath D Feb. 8, 2021, 2:34 a.m. OK GNU C++11 TESTS 51 1512 244121600
106820157 SongC D Feb. 7, 2021, 4:11 p.m. OK GNU C++14 TESTS 51 1247 220160000
106831495 Hollowed D Feb. 7, 2021, 4:31 p.m. OK GNU C++14 TESTS 51 1419 276684800
106859599 Devil D Feb. 7, 2021, 10:39 p.m. OK GNU C++14 TESTS 51 1964 411955200
106798804 A.K.E.E. D Feb. 7, 2021, 3:37 p.m. OK GNU C++14 TESTS 51 1965 152883200
106859443 Devil D Feb. 7, 2021, 10:34 p.m. OK GNU C++14 TESTS 51 2230 554803200
106859574 Devil D Feb. 7, 2021, 10:38 p.m. OK GNU C++14 TESTS 51 2261 407142400
106851362 gs12117 D Feb. 7, 2021, 7:30 p.m. OK GNU C++14 TESTS 51 3181 304332800
106827553 zhangzy D Feb. 7, 2021, 4:24 p.m. OK GNU C++14 TESTS 51 3353 68300800
106852045 gs12117 D Feb. 7, 2021, 7:38 p.m. OK GNU C++14 TESTS 51 3447 372019200
106851859 gs12117 D Feb. 7, 2021, 7:36 p.m. OK GNU C++14 TESTS 51 3493 304332800
106875137 Sutaner D Feb. 8, 2021, 5:12 a.m. OK GNU C++17 TESTS 51 1122 590131200
106867976 Molewus D Feb. 8, 2021, 3:16 a.m. OK GNU C++17 TESTS 51 1279 370483200
106874705 Sutaner D Feb. 8, 2021, 5:06 a.m. OK GNU C++17 TESTS 51 1341 927744000
106873842 liouzhou_101 D Feb. 8, 2021, 4:54 a.m. OK GNU C++17 TESTS 51 1357 158924800
106822613 Jyt D Feb. 7, 2021, 4:15 p.m. OK GNU C++17 TESTS 51 1419 242790400
106851485 StickBuerak D Feb. 7, 2021, 7:32 p.m. OK GNU C++17 TESTS 51 1450 708710400
106875957 deafakioi D Feb. 8, 2021, 5:24 a.m. OK GNU C++17 TESTS 51 1575 336793600
106856963 MAOoo D Feb. 7, 2021, 9:14 p.m. OK GNU C++17 TESTS 51 1621 146841600
106854458 MAOoo D Feb. 7, 2021, 8:21 p.m. OK GNU C++17 TESTS 51 1637 373657600
106814418 TLE D Feb. 7, 2021, 4:01 p.m. OK GNU C++17 TESTS 51 1637 410624000
106868209 RiverHamster D Feb. 8, 2021, 3:21 a.m. OK GNU C++17 (64) TESTS 51 920 176128000
106816382 NotaMotuaQAQ D Feb. 7, 2021, 4:04 p.m. OK GNU C++17 (64) TESTS 51 1122 715161600
106850875 bicsi D Feb. 7, 2021, 7:23 p.m. OK GNU C++17 (64) TESTS 51 1248 318873600
106817839 jiangly D Feb. 7, 2021, 4:07 p.m. OK GNU C++17 (64) TESTS 51 1263 246886400
106833526 bicsi D Feb. 7, 2021, 4:35 p.m. OK GNU C++17 (64) TESTS 51 1325 410112000
106864924 njwrz D Feb. 8, 2021, 2:09 a.m. OK GNU C++17 (64) TESTS 51 1403 267980800
106877880 dysyn1314 D Feb. 8, 2021, 5:49 a.m. OK GNU C++17 (64) TESTS 51 1418 295628800
106783633 Benq D Feb. 7, 2021, 3:16 p.m. OK GNU C++17 (64) TESTS 51 1482 438374400
106849186 ei133333 D Feb. 7, 2021, 7:07 p.m. OK GNU C++17 (64) TESTS 51 1559 82124800
106834060 KADR D Feb. 7, 2021, 4:36 p.m. OK GNU C++17 (64) TESTS 51 1574 385126400
106872029 Spheniscine D Feb. 8, 2021, 4:26 a.m. OK Kotlin TESTS 51 4180 490700800
106873775 Spheniscine D Feb. 8, 2021, 4:53 a.m. OK Kotlin TESTS 51 4290 490700800
106876952 Spheniscine D Feb. 8, 2021, 5:37 a.m. OK Kotlin TESTS 51 4290 507801600
106874434 Spheniscine D Feb. 8, 2021, 5:03 a.m. OK Kotlin TESTS 51 4445 505446400
106874950 Spheniscine D Feb. 8, 2021, 5:10 a.m. OK Kotlin TESTS 51 4539 505446400
106874161 Spheniscine D Feb. 8, 2021, 4:59 a.m. OK Kotlin TESTS 51 4633 490700800
106876094 Spheniscine D Feb. 8, 2021, 5:26 a.m. OK Kotlin TESTS 51 4648 507801600
106873526 Spheniscine D Feb. 8, 2021, 4:49 a.m. OK Kotlin TESTS 51 4679 489574400
106873933 Spheniscine D Feb. 8, 2021, 4:55 a.m. OK Kotlin TESTS 51 4960 490700800
106871526 Spheniscine D Feb. 8, 2021, 4:18 a.m. OK Kotlin TESTS 51 4976 490700800

remove filters

Back to search problems