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

Автор nousername, история, 9 лет назад, По-английски

245G - Suggested Friends

There are link two same submissions. In this problem first submission is sent at 2012-12-05 18:18:36 and it got Accepted. And the second submission sent today but it got TLE. I don't understand what's going on Codeforces. Could anybody help me? Thanks.

2697441

13766807

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

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

Reading with cin without sync_with_stdio is a sin. And it's TLE now probably because cin is not as good now as it was before.

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

    13767925 This is for you I add sync_with_stdio. But still TLE.

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

      It shouldn't be an issue here but don't use "endl", it's very slow.

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

      There were two separate points in my answer, the second one was actually the one which was supposed to answer your initial topic:

      And it's TLE now probably because cin is not as good now as it was before.

      There was a discussion on CF recently which probably was deleted by author since I can't find it in my recent comments, basically there it was said that around year ago CF has upgraded compilers and in current versions of GNU C++ compilers cin is much slower as it used to be and is not as fast as scanf anymore. That also means that all 'cin VS scanf' topics are outdated, at least at the moment I don't know how to make cin as fast as scanf on CF under GNU C++ compiler.

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

Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, than value 800 ms will be displayed and used to determine the verdict

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

    I don't think the problem Is that.

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

      I think that's the problem.....

      multiply AC-34'th test runtime with 2 and see.....

      No need to scroll so much , you can observe 1st test set. AC one runs for 15ms and TLE-solu runs for 30ms.