comder12's blog

By comder12, history, 21 month(s) ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
21 month(s) ago, hide # |
 
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.

»
21 month(s) ago, hide # |
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