Codeforces Round 793 (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
1682 Codeforces Round 793 (Div. 2) FINISHED False 7200 83949863 May 22, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 321 ) F MCMF? PROGRAMMING data structures flows graphs greedy sortings two pointers

B"You are given two integer arrays a and b ( b_i neq 0 and |b_i| <= q 10^9 ). Array a is sorted in non-decreasing order. The cost of a subarray a[l:r] is defined as follows: If sum limits_{j = l}^{r} b_j neq 0 , then the cost is not defined. Otherwise: You are given q queries in the form of two integers l and r . You have to compute the cost of subarray a[l:r] for each query, modulo 10^9 + 7 . If you don't know what the minimum cost of maximum flow means, read here. The first line of input contains two integers n and q (2 <= q n <= q 2 cdot 10^5, 1 <= q q <= q 2 cdot10^5) -- length of arrays a , b and the number of queries. The next line contains n integers a_1,a_2 ldots a_n ( 0 <= q a_1 <= a_2 ldots <= a_n <= q 10^9) -- the array a . It is guaranteed that a is sorted in non-decreasing order. The next line contains n integers b_1,b_2 ldots b_n (-10^9 <= q b_i <= q 10^9, b_i neq 0) -- the array b . The i -th of the next q lines contains two integers l_i,r_i (1 <= q l_i <= q r_i <= q n) . It is guaranteed that sum limits_{j = l_i}^{r_i} b_j = 0 . For each query l_i , r_i -- print the cost of subarray a[l_i:r_i] modulo 10^9 + 7 . In the first query, the maximum possible flow is 1 i.e one unit from source to 2 , then one unit from 2 to 3 , then one unit from 3 to sink. The cost of the flow is 0 cdot 1 + |2 - 4| cdot 1 + 0 cdot 1 = 2 . In the second query, the maximum possible flow is again 1 i.e from source to 7 , 7 to 6 , and 6 to sink with a cost of 0 cdot |10 - 10| cdot 1 + 0 cdot 1 = 0 . In the third query, the flow network is shown on the left with capacity written over the edge and the cost written in bracket. The image on the right shows the flow through each edge in an"...

Tutorials

Codeforces Round #793 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
158146076 leukocyte F May 23, 2022, 1:03 p.m. OK GNU C++14 TESTS 68 374 7987200
158107083 Fairy_Tale F May 23, 2022, 3:24 a.m. OK GNU C++14 TESTS 68 452 22732800
158354309 Krystallos F May 25, 2022, 5:58 a.m. OK GNU C++14 TESTS 68 514 22323200
158339735 vjudge4 F May 24, 2022, 10:56 p.m. OK GNU C++14 TESTS 68 530 10444800
158339726 L7-56 F May 24, 2022, 10:56 p.m. OK GNU C++14 TESTS 68 530 10444800
158107156 Fairy_Tale F May 23, 2022, 3:26 a.m. OK GNU C++14 TESTS 68 530 21094400
158286690 vjudge1 F May 24, 2022, 10:20 a.m. OK GNU C++14 TESTS 68 530 23552000
158286384 Tyyyyyy F May 24, 2022, 10:16 a.m. OK GNU C++14 TESTS 68 545 23552000
158276421 luogu_bot1 F May 24, 2022, 8:01 a.m. OK GNU C++14 TESTS 68 576 18329600
158112941 SuperJ6 F May 23, 2022, 5:13 a.m. OK GNU C++14 TESTS 68 670 22016000
158502901 GStnt F May 26, 2022, 7:45 a.m. OK GNU C++17 TESTS 68 436 27852800
158511063 GStnt F May 26, 2022, 9:31 a.m. OK GNU C++17 TESTS 68 451 27852800
158276704 william555 F May 24, 2022, 8:05 a.m. OK GNU C++17 TESTS 68 546 19046400
158142484 abc864197532 F May 23, 2022, 12:20 p.m. OK GNU C++17 TESTS 68 560 13414400
158404628 anodiebird F May 25, 2022, 3:45 p.m. OK GNU C++17 TESTS 68 794 20070400
158360665 northbank F May 25, 2022, 7:27 a.m. OK GNU C++17 TESTS 68 842 22937600
158110252 fallleaves07 F May 23, 2022, 4:30 a.m. OK GNU C++17 TESTS 68 1309 205516800
158464786 deepspacewaifu F May 25, 2022, 7:36 p.m. OK GNU C++17 TESTS 68 2121 39628800
158149586 AutumnKite F May 23, 2022, 1:47 p.m. OK GNU C++17 (64) TESTS 68 234 8089600
158108211 LittleCube F May 23, 2022, 3:48 a.m. OK GNU C++17 (64) TESTS 68 295 18432000
158344604 enslaved F May 25, 2022, 2:24 a.m. OK GNU C++17 (64) TESTS 68 296 26931200
158274769 leo-sis F May 24, 2022, 7:38 a.m. OK GNU C++17 (64) TESTS 68 311 13619200
158248901 JaroslavUrban F May 23, 2022, 10:25 p.m. OK GNU C++17 (64) TESTS 68 327 13824000
158104400 exzang F May 23, 2022, 2:22 a.m. OK GNU C++17 (64) TESTS 68 405 26828800
158574915 tomato_potato F May 27, 2022, 2:30 a.m. OK GNU C++17 (64) TESTS 68 436 18739200
158103880 zihouzhong F May 23, 2022, 2:07 a.m. OK GNU C++17 (64) TESTS 68 451 21094400
158143271 wygzgyw F May 23, 2022, 12:30 p.m. OK GNU C++17 (64) TESTS 68 483 14643200
158109422 froggyzhang F May 23, 2022, 4:13 a.m. OK GNU C++17 (64) TESTS 68 577 70041600
158235769 A_G F May 23, 2022, 6:14 p.m. OK GNU C++20 (64) TESTS 68 187 8089600
158159863 A_G F May 23, 2022, 2:43 p.m. OK GNU C++20 (64) TESTS 68 187 8089600
158277502 Daud_Muratbekov F May 24, 2022, 8:16 a.m. OK GNU C++20 (64) TESTS 68 296 13721600
158404108 sky123 F May 25, 2022, 3:39 p.m. OK GNU C++20 (64) TESTS 68 312 18432000
158465247 Mc3X F May 25, 2022, 7:38 p.m. OK GNU C++20 (64) TESTS 68 358 21504000
158119098 A_G F May 23, 2022, 6:47 a.m. OK GNU C++20 (64) TESTS 68 358 27443200
158141716 brunovsky F May 23, 2022, 12:10 p.m. OK GNU C++20 (64) TESTS 68 389 26624000
158348061 blackbird137 F May 25, 2022, 4:03 a.m. OK GNU C++20 (64) TESTS 68 452 22425600
158122182 frame233 F May 23, 2022, 7:32 a.m. OK GNU C++20 (64) TESTS 68 468 16384000
158296611 ButterCake F May 24, 2022, 12:23 p.m. OK GNU C++20 (64) TESTS 68 826 12800000

remove filters

Back to search problems