blackCraker's blog

By blackCraker, history, 4 weeks ago, In English

Hello everyone, I need help please. For given problem: https://codeforces.com/problemset/problem/1574/C my submission: https://codeforces.com/contest/1574/submission/130212274 My code is giving right answer but on test case 6, it is showing TLE, which it shouldn't as I just used around 2nlogn+5n operations, which I think shouldn't cause problem. Also, I doubt that whether TLE is because of sorting of vector , or maybe sorting of vector<pair<long long,int>>, I don't know , please tell me something.

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

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
4 weeks ago, # |
  Vote: I like it +8 Vote: I do not like it

Read in your input fast.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks a lot bro. I didn't even knew about it, I don't know what else do I have to know for CP. Actually, when I used to see other people's code, the line "ios_base::sync_with_stdio(false);" didn't used to make any sense to me, but now I know it