Codeforces Round 789 (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
1677 Codeforces Round 789 (Div. 1) FINISHED False 7200 85245863 May 8, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 579 ) E Tokitsukaze and Beautiful Subsegments PROGRAMMING data structures

B"Tokitsukaze has a permutation p of length n . Let's call a segment [l,r] beautiful if there exist i and j satisfying p_i cdot p_j = max {p_l, p_{l+1}, ldots, p_r } , where l <= q i < j <= q r . Now Tokitsukaze has q queries, in the i -th query she wants to know how many beautiful subsegments [x,y] there are in the segment [l_i,r_i] (i. e. l_i <= q x <= q y <= q r_i ). The first line contains two integers n and q ( 1 <= q n <= q 2 cdot 10^5 ; 1 <= q q <= q 10^6 ) -- the length of permutation p and the number of queries. The second line contains n distinct integers p_1, p_2, ldots, p_n ( 1 <= q p_i <= q n ) -- the permutation p . Each of the next q lines contains two integers l_i and r_i ( 1 <= q l_i <= q r_i <= q n ) -- the segment [l_i,r_i] of this query. For each query, print one integer -- the numbers of beautiful subsegments in the segment [l_i,r_i] . In the first example, for the first query, there are 2 beautiful subsegments -- [1,2] and [1,3] . "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
156344104 LZDQ E May 8, 2022, 4:22 p.m. OK GNU C++14 TESTS 70 1200 87654400
156371668 Eric_hooo E May 9, 2022, 12:56 a.m. OK GNU C++14 TESTS 70 1232 72499200
156356664 jumpmelon E May 8, 2022, 6:23 p.m. OK GNU C++14 TESTS 70 1809 249139200
156348675 feecIe6418 E May 8, 2022, 4:34 p.m. OK GNU C++14 TESTS 70 2058 148582400
156346713 yinianzhijian E May 8, 2022, 4:30 p.m. OK GNU C++14 TESTS 70 2479 195788800
156345838 Itsuka__Shido E May 8, 2022, 4:27 p.m. OK GNU C++14 TESTS 70 2527 142745600
156376159 L7-56 E May 9, 2022, 2:46 a.m. OK GNU C++14 TESTS 70 3103 163123200
156325230 cnnfls_csy E May 8, 2022, 3:24 p.m. OK GNU C++14 TESTS 70 3244 442675200
156377381 suyiheng E May 9, 2022, 3:15 a.m. OK GNU C++14 TESTS 70 3431 107724800
156333464 ttklwxx E May 8, 2022, 3:47 p.m. OK GNU C++14 TESTS 70 3993 230707200
156367874 Marckess E May 8, 2022, 10:27 p.m. OK GNU C++17 TESTS 70 1106 69427200
156340956 ugly2333 E May 8, 2022, 4:11 p.m. OK GNU C++17 TESTS 70 1434 179200000
156346343 ZhouShang2003 E May 8, 2022, 4:29 p.m. OK GNU C++17 TESTS 70 1949 139059200
156368314 wifiiii E May 8, 2022, 10:43 p.m. OK GNU C++17 TESTS 70 2261 117452800
156342333 DerekFeng E May 8, 2022, 4:16 p.m. OK GNU C++17 TESTS 70 2277 167731200
156371944 juju054 E May 9, 2022, 1:06 a.m. OK GNU C++17 TESTS 70 2292 119193600
156372319 ErdemKirez E May 9, 2022, 1:19 a.m. OK GNU C++17 TESTS 70 2371 200601600
156328868 ABitstOCHASTIC E May 8, 2022, 3:34 p.m. OK GNU C++17 TESTS 70 2714 344576000
156351915 ILLENIUM E May 8, 2022, 5:29 p.m. OK GNU C++17 TESTS 70 2947 206848000
156372248 ErdemKirez E May 9, 2022, 1:17 a.m. OK GNU C++17 TESTS 70 3743 242380800
156351067 Juanzhang E May 8, 2022, 5:23 p.m. OK GNU C++17 (64) TESTS 70 561 75673600
156331386 ainta E May 8, 2022, 3:41 p.m. OK GNU C++17 (64) TESTS 70 1153 89600000
156338179 relyt871 E May 8, 2022, 4:02 p.m. OK GNU C++17 (64) TESTS 70 1294 89497600
156345282 kotatsugame E May 8, 2022, 4:25 p.m. OK GNU C++17 (64) TESTS 70 1450 65638400
156354054 Kirill22 E May 8, 2022, 5:51 p.m. OK GNU C++17 (64) TESTS 70 1512 51814400
156334099 QAQAutoMaton E May 8, 2022, 3:49 p.m. OK GNU C++17 (64) TESTS 70 1669 215756800
156352051 Andreasyan E May 8, 2022, 5:30 p.m. OK GNU C++17 (64) TESTS 70 1824 100147200
156352409 Andreasyan E May 8, 2022, 5:33 p.m. OK GNU C++17 (64) TESTS 70 1871 100147200
156356586 errorgorn E May 8, 2022, 6:21 p.m. OK GNU C++17 (64) TESTS 70 1871 265523200
156350924 balbit E May 8, 2022, 5:23 p.m. OK GNU C++17 (64) TESTS 70 1933 144793600
156373186 rsy E May 9, 2022, 1:45 a.m. OK GNU C++20 (64) TESTS 70 795 78233600
156335361 jiangly E May 8, 2022, 3:53 p.m. OK GNU C++20 (64) TESTS 70 842 67584000
156370901 Alex_Wei E May 9, 2022, 12:27 a.m. OK GNU C++20 (64) TESTS 70 920 224051200
156351604 Elegia E May 8, 2022, 5:27 p.m. OK GNU C++20 (64) TESTS 70 982 86937600
156340153 ksun48 E May 8, 2022, 4:09 p.m. OK GNU C++20 (64) TESTS 70 1060 134041600
156353674 emorgan5289 E May 8, 2022, 5:46 p.m. OK GNU C++20 (64) TESTS 70 1075 235622400
156367594 Mangooste E May 8, 2022, 10:18 p.m. OK GNU C++20 (64) TESTS 70 1263 89088000
156331815 maroonrk E May 8, 2022, 3:42 p.m. OK GNU C++20 (64) TESTS 70 1387 138137600
156352668 liouzhou_101 E May 8, 2022, 5:35 p.m. OK GNU C++20 (64) TESTS 70 1388 171929600
156373966 frame233 E May 9, 2022, 2:06 a.m. OK GNU C++20 (64) TESTS 70 1496 124313600

remove filters

Back to search problems