|  | 
|  | 
| вернуться в форум | Who can help me?! Are there some hints or something like that??? I need help with this problem. I wrote a few versions ofcode but every time I get WA! Give me a tip how to do this.
Re: Who can help me?! Are there some hints or something like that??? You can use an algorithm with complexity O(n) :
 D[i] := A[1] -> A[i] !
 => Sum (i,i+K-1) = D[i+k-1] - D[i-1] ;
 Is it enough ?
 | 
 | 
|