SliferSkyd's blog

By SliferSkyd, history, 18 months ago,

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).

• +18

By SliferSkyd, history, 21 month(s) ago,

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!

• +10

By SliferSkyd, history, 3 years ago,

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!

• +5

By SliferSkyd, history, 3 years ago,

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!

• +6

By SliferSkyd, 3 years ago,

Hello everyone,

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