11381 - Elegant Strings

All about problems in Volume 113. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Monsoon
Learning poster
Posts: 66
Joined: Fri Jul 23, 2004 4:42 pm
Location: Poland

11381 - Elegant Strings

Post by Monsoon »

What is answer for

Code: Select all

1
adsdsf

are there any tricky testcases?

EDIT: bug found
Last edited by Monsoon on Sat Jan 05, 2008 10:21 pm, edited 1 time in total.
sunny
Experienced poster
Posts: 124
Joined: Sun Sep 11, 2005 10:22 pm
Location: Civil-BUET

Post by sunny »

You mean where S/T may be a empty string?

Well there are no such cases in the input file.
sonyckson
New poster
Posts: 49
Joined: Tue Feb 06, 2007 9:29 pm
Location: Cordoba, Argentina

Post 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.
shanto86
Experienced poster
Posts: 160
Joined: Wed Jul 30, 2003 8:10 pm

Post by shanto86 »

the problem can be reduced to a matching problem.
Self judging is the best judging!
tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm

Post by tobby »

A matching problem? Matching what? Could you give more hints?

What I can think of is only a brute-force search.... :(
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio »

Hint:
One match means you could reduce the numbers of substrings by one.

-----
Rio
tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm

Post 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?
Monsoon
Learning poster
Posts: 66
Joined: Fri Jul 23, 2004 4:42 pm
Location: Poland

Post 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.
tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm

Post 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.
Post Reply

Return to “Volume 113 (11300-11399)”