M.Ibrahim_'s blog

By M.Ibrahim_, history, 7 years ago, In English

can any one help me and tell me why this code get TLE 56138526

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
7 years ago, hide # |
← Rev. 3  
Vote: I like it 0 Vote: I do not like it

one solution same like u may refer.

change memset to for i = 0 to n ... arr[i] =0

»
7 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think it's because you do memset(arr,0,sizeof arr) every testcase (it takes 200005 iterations)