276 DIV2D

Правка en1, от speedster, 2015-06-27 22:13:16

Hello codeforces community . I was stuck in this problem was quite sometime . So decided to view the editorial . LINK . I completely understood the editorial but having a hard time understanding why it works . What is the reason behind this. I'll try to explain the method: — we will start will smallest a[i] and for each a[i] we will run a loop from ( j= 2*a[i] till 2*maximum_element_of_array with increment of a[i] (just like sieve) at each j we will find the number which is JUST less than this j present inside the array .If this number j compares greater than a[i] we will store the result in the variable ans . REFERENCE SOL Thank you . plz help me out :)

Теги no body reads tags, armani watches

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский speedster 2015-06-27 22:13:16 826 Initial revision (published)