_asmah98's blog

By _asmah98, history, 6 years ago, In English

Not sure why this code gives TLE.

Any help will be appreciated !

Link to Submission

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by _asmah98 (previous revision, new revision, compare).

»
6 years ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

There is no need of map and all those fancy stuff . Things will be faster and easier with bitmasking and bitwise operators . U can refer my code https://mirror.codeforces.com/contest/1341/submission/77843630

»
6 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

or you could just do it in o(n) with greedy