Round 318 Div1 B solution

Revision en1, by I_love_Captain_America, 2015-08-30 13:48:03

The editorial and problem setter's code is not clear to me. Can someone explain the code. I don't understand how he reduced O( n^2 ) to just O( n ) . Please explain this to me .

Thanks!

Tags dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English I_love_Captain_America 2015-08-30 13:48:03 213 Initial revision (published)