Quirkless's blog

By Quirkless, history, 3 years ago, In English

Hello everyone, I need help please. For given problem: https://codeforces.net/problemset/problem/1574/C my submission: https://codeforces.net/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
  • +10
  • Vote: I do not like it

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

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

»
3 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Read in your input fast.

  • »
    »
    3 years 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