Ishtiaq11's blog

By Ishtiaq11, 9 years ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

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

first we can't see what problem you are talking about because the link goes to your submissions but if you talk about this submission the answer is simple .... your code is O(n * m * q) which is too much for this problem as n*m*q = 1250000000

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

    Why this is accepted?

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

      tbh i just think that this step has saved him

      a[x][y]=1-a[x][y];

      instead of putting ifs

      he should have gotten timelimit. To solve the question you should have added an array which keeps maximum contiguos 1's in each row.

      And update the row that gets changed.To get complexity of O(n+m)q);