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

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

Hello Guys, Please help me, I am getting TLE but the complexity of my program is around O(n*logn + n + n + n + T) where n and t both are 5e6. The time limit is 3 sec. I think it should work. Please help. https://codeforces.com/contest/546/submission/145049261

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

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

In this case the input is taking a lot of time. You must add such code at the begin of the main function and all will be ok. ios_base::sync_with_stdio(false); cin.tie(0);

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

    I think its there, #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

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

      oh my bad I havn't added the fastio in the main

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

      Yes, but there is no word fastio() in your code and compiler doesn't put ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) anywhere