Блог пользователя Quirkless

Автор Quirkless, история, 3 года назад, По-английски

Hello everyone, I need help please. For given problem: https://mirror.codeforces.com/problemset/problem/1574/C my submission: https://mirror.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.

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Read in your input fast.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    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