Page 1 of 1

11381 - Elegant Strings

Posted: Sat Jan 05, 2008 9:20 pm
by Monsoon
What is answer for

Code: Select all

1
adsdsf

are there any tricky testcases?

EDIT: bug found

Posted: Sat Jan 05, 2008 9:33 pm
by sunny
You mean where S/T may be a empty string?

Well there are no such cases in the input file.

Posted: Mon Jan 07, 2008 6:46 pm
by sonyckson
Hello!, any hint for this problem? i cant even figure out a way to get the minimum amount of strings possible by splitting T... Thanks!, Eric.

Posted: Mon Jan 07, 2008 7:56 pm
by shanto86
the problem can be reduced to a matching problem.

Posted: Fri Jan 11, 2008 11:19 am
by tobby
A matching problem? Matching what? Could you give more hints?

What I can think of is only a brute-force search.... :(

Posted: Fri Jan 11, 2008 11:28 am
by rio
Hint:
One match means you could reduce the numbers of substrings by one.

-----
Rio

Posted: Fri Jan 11, 2008 11:34 am
by tobby
Ah, so you mean using T as the nodes, and from S we get the edges? Then we need a mincost maxflow algorithm?

Posted: Fri Jan 11, 2008 2:20 pm
by Monsoon
tobby wrote:Ah, so you mean using T as the nodes, and from S we get the edges? Then we need a mincost maxflow algorithm?
I won't say anything new, but it much helps when you think about reduction to minimum cost path cover of DAG. In CLR there is solution to minimum path cover of DAG and when someone understand it right, this task should be fairly easy.

Posted: Fri Jan 11, 2008 8:22 pm
by tobby
I use the idea that I mentioned in my post and get accepted.

This task would be easy to those who have a well-coded mincost maxflow code in hand. I didn't have one, so I just apply the mcmf code in shygypsy.com.