You are not logged in. Please login at to post your questions!


MINVOTE(March Long Challenge)

Can anyone explain me why this approach is giving TLE in last 2 test cases. Here I am maintaining prefix sum and doing iteration for ji . Link-

asked 13 Mar, 10:04

ankush23's gravatar image

accept rate: 0%

You used two nested loops ,so time complexity of your solution is $O(n^2)$, which will for sure cannot pass those test cases as sum of $N$ in all test cases is $\leq{10^6}$ Refer to this editorial for alternative approach and my explanation of time comlexity. MINVOTE EDITORIAL

Please upvote my answer if you got the point as I need 3 karma points to contribute to codechef discuss.


answered 13 Mar, 13:07

pshishod2645's gravatar image

accept rate: 13%

edited 13 Mar, 13:45

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 13 Mar, 10:04

question was seen: 345 times

last updated: 14 Mar, 16:49