### affix's blog

By affix, 7 years ago, we define function f(i,j) on array A as below:

f(i,j) = (i-j)^2 + (A[i+1] + A[i+2] + A[i+3] + ... + A[j])^2

find the minimum value of function f.

2 <= A.size <= 10^5

-10^4 <= A[i] <= 10^4 By affix, 8 years ago, We've got n nonnegative numbers (a[i]) . We want to find the pair with maximum gcd. For example if we have:

2 4 5 15

gcd(2,4)=2

gcd(2,5)=1

gcd(2,15)=1

gcd(4,5)=1

gcd(4,15)=1

gcd(5,15)=5

n<100,000 and a[i]<100,000

I have an O(n*sqrt(n)) algorithm is there more efficient algorithm like O(n*logn) or O(n)? gcd,
By affix, 8 years ago, We've got n nonnegative numbers (a[i]) . We want to find the pair with maximum gcd. For example if we have:

2 4 5 15

gcd(2,4)=2

gcd(2,5)=1

gcd(2,15)=1

gcd(4,5)=1

gcd(4,15)=1

gcd(5,15)=5

n<100,000 and a[i]<100,000

I have an O(n*sqrt(n)) algorithm is there more efficient algorithm like O(n*logn) or O(n)? gcd,
By affix, 10 years ago, Hi. I need an Implementation of Fenwick tree in C++ that can support lazy propagation. Can you help me? By affix, 10 years ago, Hi.
there is such a simple & cool game "flood it!".
i wonder is there any optimal algorithm that could discover what are the best choices in the game to finish it in minimum step?
if you just play once you could understand the rules of the game. game,
By affix, 10 years ago, Hi.
please give negative vote to this blog to make it WORST BLOG EVER.... blog,
By affix, 10 years ago, Hi everyone!

Here are two contest calendar.
I hope they'll be useful.... By affix, 10 years ago, Hi everyone.
i was accepting some easy problems and reading peoples code in solution size order.
and in most problems C++ was not best language and vice versa when i was reading solutions in harder problems C++ was  better than other languages in solution size.
which language is winner? c++,
By affix, 10 years ago,  