Can U discribe my an idea of O(K^2) solving?
Can U discribe my an idea of O(K^2) solving?
Thanks.
Re: Can U discribe my an idea of O(K^2) solving?
Dijkstra.
Vertices - quarters that can be crossed diagonally.
Re: Can U discribe my an idea of O(K^2) solving?
Can U discribe more clearly?
Should I sort diagonalles?
I don't understand the idea... :(
Re: Can U discribe my an idea of O(K^2) solving?
Two opposite corners of
quarters that can be crossed diagonally and
start and finish positions - vertices.
Edges:
Between any pair of vertices there is
an edge with weight dx+dy.
Also between two opposite corners of a quater -
an edge with weight 1.
In this graph we can (using Dijkstra) find
minimal distance between start and finish.
Re: Can U discribe my an idea of O(K^2) solving?
Thanks. AC now.
Re: Can U discribe my an idea of O(K^2) solving?
dp
Re: Can U discribe my an idea of O(K^2) solving?
Longest increasing subsequence