Help needed in CSES Problem

Revision en2, by AdnanShamsi, 2020-07-30 09:32:57

Sliding Cost

https://cses.fi/problemset/task/1077

Can someone explain how to approach this problem.#### I was trying to do it using pdbs and fenwick tree but it showed me tle on last 4 test cases
https://pastebin.com/3qBy2WBW

Tags cses, #sorting, searching

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English AdnanShamsi 2020-07-30 09:35:37 0 (published)
en4 English AdnanShamsi 2020-07-30 09:35:16 18 Tiny change: 'problem.\n------------------\nI was tr' -> 'problem.\n\nI was tr'
en3 English AdnanShamsi 2020-07-30 09:33:34 24 Tiny change: 's problem.####\nI was tr' -> 's problem.\n------------------\nI was tr'
en2 English AdnanShamsi 2020-07-30 09:32:57 4 Tiny change: 's problem.\nI was tr' -> 's problem.####\nI was tr'
en1 English AdnanShamsi 2020-07-30 09:32:03 281 Initial revision (saved to drafts)