ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1061. Buffer Manager

Who can help me?! Are there some hints or something like that???
Posted by Krzysztof Kapuscik 15 Apr 2001 20:23
I need help with this problem. I wrote a few versions of
code 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???
Posted by Hard ( DHSP ) 22 Jun 2005 21:03
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 ?