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

Автор hereicomewf, история, 9 лет назад, По-английски
  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

Автор hereicomewf, история, 9 лет назад, По-английски
  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

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

Could someone guide me for preparing for ICPC regionals. I find myself lost on how to progress. Just need some guidance :) .

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

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

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

I was trying to solve This Problem on Spoj.

The problem is to find the sum of all divisors of i where i=1 to i=N.

We have to solve this in sqrt(n) complexity.

This is the Ac'ed python Code, I couldn't figure out the logic behind this.

Please provide me with some hints..Thanks

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

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

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

Problem Link

My solution

My approach:

I applied Binary search on Mean(i.e answer to be found) and assigned weight of each edge equal to [Val-Mid] (Val is the value of each egde in the initial graph and Mid is the present Value of Mean during the binary search).

For each Mid in binary search I applied Bellman ford to check if any negative value cycle exists. I am constantly getting WA.(i even tried floyd for negative cycle detection).

Any help is appreciated.

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

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

Автор hereicomewf, 10 лет назад, По-английски
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор hereicomewf, 10 лет назад, По-английски
  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится