Блог пользователя affix

Автор affix, 9 лет назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор affix, 10 лет назад, По-английски

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

The answer is 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)?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

Автор affix, 10 лет назад, По-английски

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

The answer is 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)?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

Автор affix, 12 лет назад, По-английски

Hi. I need an Implementation of Fenwick tree in C++ that can support lazy propagation. Can you help me?

Полный текст и комментарии »

  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

Автор affix, 12 лет назад, По-английски
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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +21
  • Проголосовать: не нравится

Автор affix, 12 лет назад, По-английски
Hi.
please give negative vote to this blog to make it WORST BLOG EVER....

Полный текст и комментарии »

  • Проголосовать: нравится
  • -35
  • Проголосовать: не нравится

Автор affix, 12 лет назад, По-английски
  • Проголосовать: нравится
  • -25
  • Проголосовать: не нравится

Автор affix, 12 лет назад, По-английски
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.
what do you think about this?
which language is winner?

Полный текст и комментарии »

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

Автор affix, 12 лет назад, По-английски
Hi people!
recently i've learned about Dvorak keyboard and i want to use it but i think it would not easy to work with Dvorak after using QWERTY long time!
do you think really Dvorak is better for programming than QWERTY?
please share your ideas & experience about this.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится