comder12's blog

By comder12, history, 6 months ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

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

both codes are not same , the one which is giving tle is checking conditions after every input of second matrix which makes the overall time complexity of n*n*m*m.

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

You are not using the Fast IO statement in the first submission. Refer to this: https://stackoverflow.com/questions/31162367/significance-of-ios-basesync-with-stdiofalse-cin-tienull