Codeforces Round 852 (Div. 2)

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
1793 Codeforces Round 852 (Div. 2) FINISHED False 7200 61075463 Feb. 12, 2023, 8:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1432 ) F Rebrending PROGRAMMING brute force data structures dp implementation

B'Kostya and Zhenya -- the creators of the band "Paper" -- after the release of the legendary album decided to create a new band "Day movers", for this they need to find two new people. They invited n people to the casting. The casting will last q days. On the i th of the days, Kostya and Zhenya want to find two people on the segment from l_i to r_i who are most suitable for their band. Since "Day movers" are doing a modern art, musical skills are not important to them and they look only at other signs: they want the height difference between two people to be as small as possible. Help them, and for each day, find the minimum difference in the growth of people from the casting on this segment! In the first line you are given two integers n and q ( 2 <= q n <= q 3 cdot 10^5, 1 <= q q <= q 10^6 ) -- the number of people who came to the casting and the number of casting days. In the second line, you are given n integers a_1, a_2, a_3, ldots, a_n ( 1 <= q a_i <= q n ) -- the growth of each of the candidates. It is also guaranteed that all a_i are different. The following q lines each contains two integers l_i and r_i ( 1 <= q l_i < r_i <= q n ) -- a segment of people on the i th day of casting. Output q lines. In the i -th line there should be a minimum height difference between the two candidates on the segment on the i -th day of casting. In the first example, the minimum difference on the segment [1, 2] is 2 , on the segment [2, 3] -- 1 , on the segment [1, 3] is also 1 . In the third example, the numbers with the minimum difference on the segment [4, 6] are 3 and 5 ( 5 - 3 = 2 ). On the segment [1, 2] , the numbers with the minimum difference are 2 and 6 ( 6 - 2 = 4 ). On the segment [3, 6] , the numbers with the minimum difference are 1 and 3 ( 3'...

Tutorials

Codeforces Round #852 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
193330035 YKylin F Feb. 12, 2023, 10:31 a.m. OK GNU C++14 TESTS 56 2058 124825600
193330292 purplevine F Feb. 12, 2023, 10:32 a.m. OK GNU C++14 TESTS 56 2059 177664000
193413329 DitaMirika F Feb. 13, 2023, 2:30 a.m. OK GNU C++14 TESTS 58 2105 85094400
193330135 dcytrl F Feb. 12, 2023, 10:31 a.m. OK GNU C++14 TESTS 56 2106 129638400
193406580 dqstz F Feb. 12, 2023, 11:18 p.m. OK GNU C++14 TESTS 56 2136 97382400
193414406 Oscaryang F Feb. 13, 2023, 2:55 a.m. OK GNU C++14 TESTS 58 2230 23244800
193411374 EricKong F Feb. 13, 2023, 1:36 a.m. OK GNU C++14 TESTS 58 2308 185139200
193412459 OccDreamer_ F Feb. 13, 2023, 2:09 a.m. OK GNU C++14 TESTS 58 2464 40038400
193412481 OccDreamer F Feb. 13, 2023, 2:09 a.m. OK GNU C++14 TESTS 58 2573 40038400
193344932 aaa32123 F Feb. 12, 2023, 12:40 p.m. OK GNU C++14 TESTS 56 2667 218419200
193415768 EnofTaiPeople F Feb. 13, 2023, 3:29 a.m. OK GNU C++17 TESTS 58 1450 143155200
193422591 jaimanpandya F Feb. 13, 2023, 5:42 a.m. OK GNU C++17 TESTS 58 1465 32051200
193389083 dmenezes F Feb. 12, 2023, 7 p.m. OK GNU C++17 TESTS 56 1528 32051200
193378804 mister F Feb. 12, 2023, 5:29 p.m. OK GNU C++17 TESTS 56 1559 28467200
193415163 User_Carrot F Feb. 13, 2023, 3:15 a.m. OK GNU C++17 TESTS 58 1559 31539200
193389257 dmenezes F Feb. 12, 2023, 7:01 p.m. OK GNU C++17 TESTS 56 1590 32051200
193415729 LilyCuSO4 F Feb. 13, 2023, 3:29 a.m. OK GNU C++17 TESTS 58 1606 32051200
193412603 SF-Manman F Feb. 13, 2023, 2:12 a.m. OK GNU C++17 TESTS 58 1606 32051200
193381142 Mawina F Feb. 12, 2023, 5:48 p.m. OK GNU C++17 TESTS 56 1606 85811200
193415712 SSUUII F Feb. 13, 2023, 3:28 a.m. OK GNU C++17 TESTS 58 1934 39833600
193417346 FredYourMind F Feb. 13, 2023, 4:06 a.m. OK GNU C++17 (64) TESTS 58 811 36454400
193417304 FredYourMind F Feb. 13, 2023, 4:05 a.m. OK GNU C++17 (64) TESTS 58 857 34508800
193417153 FredYourMind F Feb. 13, 2023, 4:01 a.m. OK GNU C++17 (64) TESTS 58 982 37478400
193417027 FredYourMind F Feb. 13, 2023, 3:57 a.m. OK GNU C++17 (64) TESTS 58 998 37478400
193417109 FredYourMind F Feb. 13, 2023, 3:59 a.m. OK GNU C++17 (64) TESTS 58 1091 37478400
193417092 FredYourMind F Feb. 13, 2023, 3:59 a.m. OK GNU C++17 (64) TESTS 58 1122 37478400
193410624 wanghai673 F Feb. 13, 2023, 1:14 a.m. OK GNU C++17 (64) TESTS 58 1388 37478400
193366548 Kumarfeldspar F Feb. 12, 2023, 3:45 p.m. OK GNU C++17 (64) TESTS 56 1419 55705600
193400104 BingDong F Feb. 12, 2023, 9:11 p.m. OK GNU C++17 (64) TESTS 56 2168 37683200
193418072 chuchu F Feb. 13, 2023, 4:21 a.m. OK GNU C++17 (64) TESTS 58 2262 34099200
193372435 turmax F Feb. 12, 2023, 4:37 p.m. OK GNU C++20 (64) TESTS 56 545 54784000
193372071 turmax F Feb. 12, 2023, 4:34 p.m. OK GNU C++20 (64) TESTS 56 670 109260800
193370943 turmax F Feb. 12, 2023, 4:24 p.m. OK GNU C++20 (64) TESTS 56 858 109056000
193415867 Kidding__Ma F Feb. 13, 2023, 3:32 a.m. OK GNU C++20 (64) TESTS 58 1263 37478400
193370158 turmax F Feb. 12, 2023, 4:18 p.m. OK GNU C++20 (64) TESTS 56 1263 109056000
193337749 aliflov F Feb. 12, 2023, 11:35 a.m. OK GNU C++20 (64) TESTS 56 1388 107417600
193408550 Tx_Lcy F Feb. 13, 2023, 12:13 a.m. OK GNU C++20 (64) TESTS 57 1403 107417600
193391971 ivls F Feb. 12, 2023, 7:30 p.m. OK GNU C++20 (64) TESTS 56 1403 107417600
193338206 Olenyeva F Feb. 12, 2023, 11:39 a.m. OK GNU C++20 (64) TESTS 56 1403 140288000
193408462 Tx_Lcy F Feb. 13, 2023, 12:10 a.m. OK GNU C++20 (64) TESTS 57 1404 107417600
193337943 aliflov F Feb. 12, 2023, 11:37 a.m. OK Go TESTS 56 2464 171315200
193348778 bvf F Feb. 12, 2023, 1:14 p.m. OK Go TESTS 56 2496 164454400
193416663 Spheniscine F Feb. 13, 2023, 3:49 a.m. OK Rust 2021 TESTS 58 1340 71987200
193416440 Spheniscine F Feb. 13, 2023, 3:44 a.m. OK Rust 2021 TESTS 58 2620 76185600
193416368 Spheniscine F Feb. 13, 2023, 3:43 a.m. OK Rust 2021 TESTS 58 2979 93798400
193416239 Spheniscine F Feb. 13, 2023, 3:40 a.m. OK Rust 2021 TESTS 58 3619 106393600
193394631 wnmrmr F Feb. 12, 2023, 7:59 p.m. OK Rust 2021 TESTS 56 3837 90521600

remove filters

Back to search problems