Codeforces Round 535 (Div. 3)

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
1108 Codeforces Round 535 (Div. 3) FINISHED False 7200 183569099 Jan. 23, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2216 ) E2 Array and Segments (Hard version) PROGRAMMING data structures implementation 2300

B'The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i -th element of the array is a_i . You are also given a set of m segments. The j -th segment is [l_j; r_j] , where 1 <= l_j <= r_j <= n . You can choose some subset of the given set of segments and decrease values on each of the chosen segments by one (independently). For example, if the initial array a = [0, 0, 0, 0, 0] and the given segments are [1; 3] and [2; 4] then you can choose both of them and the array will become b = [-1, -2, -2, -1, 0] . You have to choose some subset of the given segments (each segment can be chosen at most once) in such a way that if you apply this subset of segments to the array a and obtain the array b then the value max limits_{i=1}^{n}b_i - min limits_{i=1}^{n}b_i will be maximum possible. Note that you can choose the empty set. If there are multiple answers, you can print any. If you are Python programmer, consider using PyPy instead of Python when you submit your code. The first line of the input contains two integers n and m ( 1 <= n <= 10^5, 0 <= m <= 300 ) -- the length of the array a and the number of segments, respectively. The second line of the input contains n integers a_1, a_2, ... , a_n ( -10^6 <= a_i <= 10^6 ), where a_i is the value of the i -th element of the array a . The next m lines are contain two integers each. The j -th of them contains two integers l_j and r_j ( 1 <= l_j <= r_j <= n ), where l_j and r_j are the ends of the j -th segment. In the first line of the output print one integer d -- the maximum possible value max limits_{i=1}^{n}b_i - min limits_{i=1}^{n}b_i if b is the array obtained by applying some subset of the given s'...

Tutorials

64751

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
54701969 Denor E2 May 27, 2019, 12:58 a.m. OK Delphi TESTS 106 171 4505600 2300
49345325 PhuongPeu E2 Feb. 2, 2019, 5:07 a.m. OK FPC TESTS 106 62 4505600 2300
49190408 s0199988819 E2 Jan. 30, 2019, 8 a.m. OK GNU C11 TESTS 106 46 9420800 2300
49190287 s0199988819 E2 Jan. 30, 2019, 7:57 a.m. OK GNU C11 TESTS 106 46 52326400 2300
49104077 Robbinb1993 E2 Jan. 28, 2019, 12:26 p.m. OK GNU C++11 TESTS 106 31 6041600 2300
49693394 dream_maker E2 Feb. 10, 2019, 12:30 p.m. OK GNU C++11 TESTS 106 31 6860800 2300
48948271 newbiechdboom0 E2 Jan. 25, 2019, 8:38 p.m. OK GNU C++11 TESTS 106 31 8601600 2300
49938584 misaka27149 E2 Feb. 15, 2019, 8:30 a.m. OK GNU C++11 TESTS 106 46 512000 2300
49023726 xht37 E2 Jan. 26, 2019, 6:10 p.m. OK GNU C++11 TESTS 106 46 1740800 2300
66048296 xht37 E2 Nov. 30, 2019, 4:03 p.m. OK GNU C++11 TESTS 106 46 1740800 2300
48918617 dredwerkz E2 Jan. 25, 2019, 6:40 a.m. OK GNU C++11 TESTS 106 46 2560000 2300
49301629 oos1111 E2 Feb. 1, 2019, 3:25 a.m. OK GNU C++11 TESTS 106 46 3686400 2300
49364852 heyuhhh E2 Feb. 2, 2019, 2:34 p.m. OK GNU C++11 TESTS 106 46 4608000 2300
50595847 vjudge2 E2 Feb. 28, 2019, 10:08 a.m. OK GNU C++11 TESTS 106 46 4812800 2300
48920381 detaomega E2 Jan. 25, 2019, 7:32 a.m. OK GNU C++14 TESTS 106 31 716800 2300
50325041 mdj982 E2 Feb. 22, 2019, 4:05 p.m. OK GNU C++14 TESTS 106 46 2662400 2300
49214572 nikolos00 E2 Jan. 30, 2019, 4:44 p.m. OK GNU C++14 TESTS 106 46 4198400 2300
49213495 p1rattttt E2 Jan. 30, 2019, 4:22 p.m. OK GNU C++14 TESTS 106 46 4608000 2300
49213639 p1rattttt E2 Jan. 30, 2019, 4:26 p.m. OK GNU C++14 TESTS 106 46 4608000 2300
69603977 Captain_Knuckles E2 Jan. 27, 2020, 9 a.m. OK GNU C++14 TESTS 106 46 5017600 2300
48980674 DICS E2 Jan. 26, 2019, 10:32 a.m. OK GNU C++14 TESTS 106 46 5120000 2300
53056555 ritesh1340 E2 April 20, 2019, 5:52 p.m. OK GNU C++14 TESTS 106 46 5427200 2300
60671609 aka.Sohieb E2 Sept. 16, 2019, 10:55 a.m. OK GNU C++14 TESTS 106 46 5734400 2300
49492778 BrokenDummy E2 Feb. 5, 2019, 11:02 a.m. OK GNU C++14 TESTS 106 46 5836800 2300
48914127 Narut E2 Jan. 25, 2019, 4:26 a.m. OK GNU C++17 TESTS 106 46 819200 2300
67785882 zuhn E2 Dec. 28, 2019, 12:45 p.m. OK GNU C++17 TESTS 106 46 1126400 2300
52064612 xolodec E2 March 31, 2019, 4:27 a.m. OK GNU C++17 TESTS 106 46 2560000 2300
53052576 ay2306 E2 April 20, 2019, 3:23 p.m. OK GNU C++17 TESTS 106 46 3788800 2300
49335617 Stroustrup E2 Feb. 1, 2019, 6:19 p.m. OK GNU C++17 TESTS 106 46 3891200 2300
61549376 qpzm E2 Sept. 30, 2019, 11:52 a.m. OK GNU C++17 TESTS 106 46 3993600 2300
48986761 hell_hacker E2 Jan. 26, 2019, 12:38 p.m. OK GNU C++17 TESTS 106 46 3993600 2300
66746582 KevinWan E2 Dec. 13, 2019, 2:56 a.m. OK GNU C++17 TESTS 106 46 4812800 2300
49445858 rr1500 E2 Feb. 4, 2019, 2:53 a.m. OK GNU C++17 TESTS 106 46 5529600 2300
51780980 Natsuhltk1 E2 March 24, 2019, 4:43 a.m. OK GNU C++17 TESTS 106 46 6144000 2300
48923443 2008061626 E2 Jan. 25, 2019, 9:02 a.m. OK Go TESTS 106 202 18739200 2300
49067106 AJ47 E2 Jan. 27, 2019, 6:19 p.m. OK Java 8 TESTS 106 140 0 2300
49760172 Jarik E2 Feb. 11, 2019, 8:32 a.m. OK Java 8 TESTS 106 140 0 2300
49066728 vivekiitian E2 Jan. 27, 2019, 6:07 p.m. OK Java 8 TESTS 106 155 7884800 2300
49066678 vivekiitian E2 Jan. 27, 2019, 6:06 p.m. OK Java 8 TESTS 106 155 7884800 2300
48906203 icpc_loser E2 Jan. 24, 2019, 8:36 p.m. OK Java 8 TESTS 106 156 6041600 2300
51109711 nchn27 E2 March 10, 2019, 3:16 a.m. OK Java 8 TESTS 106 171 3584000 2300
48914378 amolpratap007 E2 Jan. 25, 2019, 4:37 a.m. OK Java 8 TESTS 106 171 4608000 2300
48914361 _codophobia_ E2 Jan. 25, 2019, 4:36 a.m. OK Java 8 TESTS 106 171 4608000 2300
48958236 mTvTm E2 Jan. 26, 2019, 5:33 a.m. OK Java 8 TESTS 106 171 6041600 2300
49066523 vivekiitian E2 Jan. 27, 2019, 6 p.m. OK Java 8 TESTS 106 171 7372800 2300
49080109 fr0st E2 Jan. 28, 2019, 5:49 a.m. OK Mono C# TESTS 106 140 23347200 2300
50236646 NEvOl E2 Feb. 20, 2019, 11:02 a.m. OK Mono C# TESTS 106 218 22016000 2300
51276039 Mosyagin E2 March 13, 2019, 9:25 p.m. OK Mono C# TESTS 106 249 13004800 2300
49204921 Kroete E2 Jan. 30, 2019, 1:37 p.m. OK MS C++ TESTS 106 93 819200 2300
49205483 Kroete E2 Jan. 30, 2019, 1:46 p.m. OK MS C++ TESTS 106 109 409600 2300
50084688 vjudge4 E2 Feb. 18, 2019, 6:45 a.m. OK MS C++ TESTS 106 124 4812800 2300
50084671 ys1468362286 E2 Feb. 18, 2019, 6:45 a.m. OK MS C++ TESTS 106 140 4812800 2300
49630513 nik1998 E2 Feb. 8, 2019, 3:46 p.m. OK MS C++ TESTS 106 155 41267200 2300
62977580 vjudge3 E2 Oct. 20, 2019, 9:08 a.m. OK MS C++ TESTS 106 404 164454400 2300
50241438 zhaoy1ping E2 Feb. 20, 2019, 1:06 p.m. OK MS C++ 2017 TESTS 106 62 11264000 2300
48953092 elvinaa E2 Jan. 26, 2019, 2:06 a.m. OK MS C++ 2017 TESTS 106 124 4812800 2300
50522925 tangbinjie E2 Feb. 26, 2019, 10:22 a.m. OK MS C++ 2017 TESTS 106 140 4812800 2300
69713569 pichulia E2 Jan. 29, 2020, 8:05 a.m. OK MS C++ 2017 TESTS 106 358 4096000 2300
50871159 dawn_LL E2 March 6, 2019, 1:48 a.m. OK MS C++ 2017 TESTS 106 358 140083200 2300
58219559 yorky E2 Aug. 3, 2019, 12:04 p.m. OK MS C++ 2017 TESTS 106 561 1638400 2300
48909798 Kaktoos E2 Jan. 25, 2019, 1:04 a.m. OK PyPy 3 TESTS 106 233 14131200 2300
49484149 orailly E2 Feb. 5, 2019, 3:32 a.m. OK Python 3 TESTS 106 202 7782400 2300
48909806 Kaktoos E2 Jan. 25, 2019, 1:04 a.m. OK Python 3 TESTS 106 343 12902400 2300
59972014 sansen E2 Sept. 4, 2019, 2:23 a.m. OK Rust TESTS 106 93 7065600 2300

remove filters

Back to search problems