nousername's blog

By nousername, history, 9 years ago, In English

245G - Возможные друзья

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

  • Vote: I like it
  • +9
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

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

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it +2 Vote: I do not like it

      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 years ago, # |
  Vote: I like it -10 Vote: I do not like it

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 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I don't think the problem Is that.

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it -6 Vote: I do not like it

      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.