SliferSkyd's blog

By SliferSkyd, history, 5 weeks ago, In English

Hi all,

I am currently stuck on a problem that can be solved by finding the minimum cost of the maximum flow in a graph with lower and upper bounds on edge capacities.

My problem combines aspects of minimum-cost flow and maximum flow with node demands. I have also come across the "Minimum Cost b-Flow" problem, which is similar, but it does not maximize the total flow.

Does anyone have any ideas for solving this problem? Thanks in advance.

Full text and comments »

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

By SliferSkyd, history, 2 years ago, In English

Hello everyone,

I have some trouble with a problem and I hope someone may help me to solve it:

Given a graph N vertices and M edges (N <= 50, M <= N * (N — 1) / 2). Each edge has a weight w (w <= 1e4). And the task is to find if there is a path with the total weight exactly equals to S (S <= 1e18).

Thanks in advance!

Full text and comments »

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

By SliferSkyd, history, 2 years ago, In English

Hello, can anyone help me with this problem:

Given N rooms (N <= 100), at first, each room was painted by one color (0, 1 or 2). There are N robots, each robot has a set of rooms that we can use to paint all elements in. For an room after painting, its color changes from 0 to 1, 1 to 2 and 2 to 0.

Calculate the minimum times need to use robots to make all the rooms have color 0. (A robot can be used multiple times).

Thanks so much!

Full text and comments »

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

By SliferSkyd, history, 3 years ago, In English

Hello everyone, can you help me with this problem:

Given a tree has N vertice (N <= 3*10^5) and a number K (K <= n — 1). Each edge in this tree has a weight W (- 10^6 <= W <= 10^6).

You should choose exactly K edges that the sum of their weight is maximum and mustn't choose 2 edges that connect with the same vertex.

I think with N and K small, this problem can be solved using dp.

Thanks!

Full text and comments »

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

By SliferSkyd, history, 4 years ago, In English

Hello,

Given a grid N x M (N x M <= 100). Your task is to count how many Hamilton cycles in this graph. Are there any algorithms to solve this?

Thanks!

Full text and comments »

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

By SliferSkyd, 4 years ago, In English

Hello everyone,

Is there an algorithm to build Suffix Array in complexity O(n)?

Thanks in advance!

Full text and comments »

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