Codeforces Round 872 (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
1824 Codeforces Round 872 (Div. 1) FINISHED False 7200 53718863 May 8, 2023, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 510 ) D LuoTianyi and the Function PROGRAMMING data structures 3000

B'LuoTianyi gives you an array a of n integers and the index begins from 1 . Define g(i,j) as follows: There are q queries. For each query you are given four integers l,r,x,y , you need to calculate sum limits_{i=l}^{r} sum limits_{j=x}^{y}g(i,j) . The first line contains two integers n and q ( 1 <= n,q <= 10^6 ) -- the length of the array a and the number of queries. The second line contains n integers a_1,a_2, ldots,a_n ( 1 <= a_i <= n ) -- the elements of the array a . Next q lines describe a query. The i -th line contains four integers l,r,x,y ( 1 <= l <= r <= n, 1 <= x <= y <= n ) -- the integers in the i -th query. Print q lines where i -th line contains one integer -- the answer for the i -th query. In the first example: In the first query, the answer is g(1,4)+g(1,5)=3+3=6 . x=1,2,3 can satisfies {a_p:1 <= p <= 4 } subseteq {a_q:x <= q <= 4 } , 3 is the largest integer so g(1,4)=3 . In the second query, the answer is g(2,3)+g(3,3)=3+3=6 . In the third query, the answer is 0 , because all i > j and g(i,j)=0 . In the fourth query, the answer is g(6,6)=6 . In the second example: In the second query, the answer is g(2,3)=2 . In the fourth query, the answer is g(1,4)+g(1,5)=2+2=4 . '...

Tutorials

CodeForces Round 872(Div. 1&2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
205237772 1092515503 D May 9, 2023, 2:32 p.m. OK GNU C++14 TESTS 40 3431 137728000 3000
205632165 Pavan125 D May 12, 2023, 6:09 p.m. OK GNU C++14 TESTS 40 3588 138137600 3000
205187477 grass8sheep D May 9, 2023, 5:53 a.m. OK GNU C++14 TESTS 40 3618 138137600 3000
205377973 arthur.nascimento D May 11, 2023, 12:22 a.m. OK GNU C++14 TESTS 40 4446 250880000 3000
205194126 XZC__Bobby D May 9, 2023, 7:25 a.m. OK GNU C++14 TESTS 40 4601 135577600 3000
205186754 roohaande D May 9, 2023, 5:41 a.m. OK GNU C++14 TESTS 40 4694 135577600 3000
205147429 sirikolipaka D May 8, 2023, 5:06 p.m. OK GNU C++14 TESTS 40 4694 135577600 3000
205094890 KING_OF_TURTLE D May 8, 2023, 12:36 p.m. OK GNU C++14 TESTS 40 4694 135577600 3000
205938799 Scintilla06 D May 15, 2023, 4:02 a.m. OK GNU C++14 TESTS 40 5771 225792000 3000
206572701 bekzhan29 D May 19, 2023, 10:08 p.m. OK GNU C++14 TESTS 40 5803 257945600 3000
205593336 21h51a6677 D May 12, 2023, 3:37 p.m. OK GNU C++17 TESTS 40 2932 121344000 3000
205388418 gottipatiyasaswini D May 11, 2023, 4:46 a.m. OK GNU C++17 TESTS 40 2932 121344000 3000
205142283 Um_nik D May 8, 2023, 4:18 p.m. OK GNU C++17 TESTS 40 3135 154214400 3000
205269485 OMG_wc D May 9, 2023, 8:29 p.m. OK GNU C++17 TESTS 40 3244 133222400 3000
205135430 Um_nik D May 8, 2023, 3:20 p.m. OK GNU C++17 TESTS 40 3260 154316800 3000
205107363 Um_nik D May 8, 2023, 1:13 p.m. OK GNU C++17 TESTS 40 3337 154316800 3000
205692956 2000032077cse D May 13, 2023, 8:35 a.m. OK GNU C++17 TESTS 40 3369 133120000 3000
205334214 conglingkaishi D May 10, 2023, 1:43 p.m. OK GNU C++17 TESTS 40 3493 133120000 3000
205273967 Sputnik12 D May 9, 2023, 10:14 p.m. OK GNU C++17 TESTS 40 3525 260812800 3000
205475432 YeXiaoRain D May 11, 2023, 8:14 p.m. OK GNU C++17 TESTS 40 3931 157593600 3000
205145048 q-w-q-w-q D May 8, 2023, 4:43 p.m. OK GNU C++17 (64) TESTS 40 1544 137420800 3000
205145099 q-w-q-w-q D May 8, 2023, 4:43 p.m. OK GNU C++17 (64) TESTS 40 1840 135372800 3000
205144309 q-w-q-w-q D May 8, 2023, 4:36 p.m. OK GNU C++17 (64) TESTS 40 1887 135372800 3000
205144380 q-w-q-w-q D May 8, 2023, 4:37 p.m. OK GNU C++17 (64) TESTS 40 1996 135372800 3000
205144699 q-w-q-w-q D May 8, 2023, 4:40 p.m. OK GNU C++17 (64) TESTS 40 2027 135372800 3000
205145139 q-w-q-w-q D May 8, 2023, 4:44 p.m. OK GNU C++17 (64) TESTS 40 2074 135372800 3000
205144931 q-w-q-w-q D May 8, 2023, 4:42 p.m. OK GNU C++17 (64) TESTS 40 2074 135372800 3000
205143813 q-w-q-w-q D May 8, 2023, 4:32 p.m. OK GNU C++17 (64) TESTS 40 2339 133222400 3000
205106777 platelet D May 8, 2023, 1:12 p.m. OK GNU C++17 (64) TESTS 40 2558 165785600 3000
205144514 q-w-q-w-q D May 8, 2023, 4:38 p.m. OK GNU C++17 (64) TESTS 40 2589 133222400 3000
205416744 becaido D May 11, 2023, 10:38 a.m. OK GNU C++20 (64) TESTS 40 1637 143052800 3000
205416879 becaido D May 11, 2023, 10:39 a.m. OK GNU C++20 (64) TESTS 40 1638 143462400 3000
205416712 becaido D May 11, 2023, 10:38 a.m. OK GNU C++20 (64) TESTS 40 1699 143052800 3000
205417031 becaido D May 11, 2023, 10:41 a.m. OK GNU C++20 (64) TESTS 40 1715 143462400 3000
205416983 becaido D May 11, 2023, 10:41 a.m. OK GNU C++20 (64) TESTS 40 1746 143052800 3000
205258263 magnus.hegdahl D May 9, 2023, 5:47 p.m. OK GNU C++20 (64) TESTS 40 1762 228352000 3000
205256203 magnus.hegdahl D May 9, 2023, 5:24 p.m. OK GNU C++20 (64) TESTS 40 1824 228352000 3000
205405374 becaido D May 11, 2023, 8:38 a.m. OK GNU C++20 (64) TESTS 40 2199 177049600 3000
205416512 becaido D May 11, 2023, 10:35 a.m. OK GNU C++20 (64) TESTS 40 2230 142643200 3000
206203365 F_Rio D May 17, 2023, 11:32 a.m. OK GNU C++20 (64) TESTS 40 2230 145305600 3000
205923660 lis05 D May 14, 2023, 9:09 p.m. OK Go TESTS 40 4788 421171200 3000
205761819 lis05 D May 13, 2023, 7:55 p.m. OK Go TESTS 40 5334 426803200 3000
205433137 lis05 D May 11, 2023, 1:09 p.m. OK Go TESTS 40 6067 427520000 3000
206036414 Spheniscine D May 16, 2023, 12:37 a.m. OK Rust 2021 TESTS 40 5647 331571200 3000
205494875 Spheniscine D May 12, 2023, 3:55 a.m. OK Rust 2021 TESTS 40 5865 264396800 3000

remove filters

Back to search problems