rohan537's blog

By rohan537, history, 5 years ago, In English

problem: 1363D - Guess The Maximums Why is my code giving idleness limit exceeded on test 8?82255684...your help will be much appreciated

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

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

Do you consider the case where the index of the maximum number is not contained in the given sets? For example, consider array $$$a$$$ to be

Unable to parse markup [type=CF_MATHJAX]

and $$$k = 2$$$ sets being {$$$1, 2$$$} and {

Unable to parse markup [type=CF_MATHJAX]

}. Ans should be

Unable to parse markup [type=CF_MATHJAX]

.

Edit: Ignore the above, you do.

Found your mistake, it was a really subtle one. In line 84, you have an if statement with the following condition adj[i][j]==ask. However, you never consider that j can be greater than adj[i].size(). Added that and got AC 82269561.

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

    thank u so much bro...i looked atleast 20 tines without noticing that