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

Автор ThomazL, история, 7 лет назад, По-английски

Hi guys,

Today i viewed a, aparently, simple seg2D problem:

SET x y d: Set position (x,y) of the grid to integer d.

QUERY x y d: Return the gcd (Greatest Common Divisor) of all positions of the grid that are at most 'd' positions away (Manhattan Distance) from position (x,y).

But i have no ideia to solve this query type '-'

Can someone help me?

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

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

Автор ThomazL, история, 7 лет назад, По-английски

Hi everyone, recently tried to solve this problem. In the forum, a guy says to settle with Floyd-Warshall, but I do not know how to do that '-'

Can anyone explain me how to solve this problem used Floyd-Warshall algorithm?

Problem in a nutshell: You have a graph (N <= 100) and M querys. Each query asks about the minimum distance between two vertices using a maximum K steps.

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

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

Автор ThomazL, история, 8 лет назад, По-английски

Hi guys,

I've read about edit distance problem. Studying this Wikipedia article. It's described one variation problem "one of which takes two strings and a maximum edit distance s, and returns min(s, d)". But i don't understand idea to solve it. Can somebody help me to understand it: "It achieves this by only computing and storing a part of the dynamic programming table around its diagonal."???

Thanks alot for help.

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

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