now if (i < j) now you want to maximize a[i]-pref[i] for each j.

Could you please help me in understanding why maximizing (a[i]-pref[i]) will give the maximized result ?? Is there any mathematical calculation or proof of correctness ?

~TIA

Active In

Comilla University Programming Contest Group

Competitive Programming

International Olympiad in Informatics

City University (BD) Programming Training Group

UI/UX Design

Technology

Algorithms and Data Structures

Featured Contributions

reply in this discussion

now if (i < j) now you want to maximize a[i]-pref[i] for each j.

Could you please help me in understanding why maximizing (a[i]-pref[i]) will give the maximized result ?? Is there any mathematical calculation or proof of correctness ?

~TIA

Read more… (41 words)

reply in this discussion

reply in this discussion

I wrote a Tutorial for this Problem . Solvers who got stuck may have a look .

Here it is: IARCS AVERAGE ( Tutorial + Solution )

Not sure about the quality of Writings. But tried my best to make everything clear.

Nice Problem indeed .

Read more… (46 words)

reply in this discussion

Can't they update their C++ Version . ??? Could you please suggest them to add the newer version ?

Read more… (19 words)

reply in this discussion

Why unorder_map does not works at IARCS OPC ??

Read more… (15 words)

reply in this discussion

Nice BS problem . But the values of V may not be lesser than any Start[i] & values W may not be greater than End[i] . But its is sure that you can at least 1 Start[i] lesser than a value of V and 1 End[i] greater than a value of W.

Read more… (52 words)

reply in this discussion

Vaiya I Solved the Problem .... And I posted the thread already .

Read more… (13 words)

reply in this discussion

There is a problem in** Subtask #1** of this problem. I tried to submit my code only for **K = 1** as per problem said for **Subtask #1** . But the last test case gives me WA for several . Although I thought it was my implementation error.

Later on I submitted the code for both Subtask #1 and Subtask #2 . And that solution gives me ACCEPTED.

It will be better if you change / suggest them to change the** Last Test Case of Subtask#1** for the beginner who will try this problem .

~TIA

Read more… (96 words)