ThomazL's blog

By ThomazL, history, 7 years ago, In English

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?

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it

By ThomazL, history, 7 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +10
  • Vote: I do not like it

By ThomazL, history, 8 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it