divyanshu3012's blog

By divyanshu3012, history, 2 months ago, In English

In the problem given below , the time limit mentioned is 1 seconds , does that mean that each testcase has 2 seconds to pass ?

  • Vote: I like it
  • -3
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
2 months ago, # |
  Vote: I like it -10 Vote: I do not like it

The allowed Time Limit is O(T * (Time complexity of your solution)). The problem that you mentioned in your image, if solved in T.C of O(N) will TLE.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Let me first define a few terms beforehand

  • Test: There are generally multiple test and each test can contain multiple testcases. When you get "WA at test-2" verdict in a contest, it means you have passed test-1 and not testcase-1.
  • Testcases: Each testcase contain multiple inputs on which your code is tested.

Coming back to your question: The time limit of $$$1$$$ seconds denote that for each test (that may contain multiple testcases) your program should take less than $$$1$$$ seconds to successfully execute it.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This timelimit is for executing a single testcase within a test or the complete test ?