Page 2 of 11
Posted: Fri Dec 13, 2002 10:38 am
by ..
You have wrong understanding on the question.
For the input:
ab
ba
the output is:
ab
Actually this question can be solved easily once you udnerstand what it asks you to do.
Posted: Sat Dec 14, 2002 6:59 am
by anupam
thank u, and sorry to disturb u.
i actually can't understand the problem.
it seems to me as a lcs prob.
i rarely put src. code in board. but sometimes when i can't get rid of a lot of wa, i become frustated and then put it.
please tell me abuot the problem and algrthm in a simpler way, please?

Posted: Mon Dec 16, 2002 10:16 am
by ..
Given two strings of lowercase letters, a and b, print the longest string x of lowercase letters such that there is a permutation of x that is a subsequence of a and there is a permutation of x that is a subsequence of b.
You miss the word permutation in the problem spec. That's why for the input
ab
ba
the output is
ab
because "ba" is a permutation of "ab" at all.
Posted: Wed Dec 18, 2002 10:40 am
by anupam
[/b]thanks.
i rarely put src code.
i just want to know what will be the case if the input
abc
acd.
is it ac?
if it is then i have understood your help and the program.
thanks for help.
Posted: Wed Dec 18, 2002 11:38 am
by Larry
Yes, that would be ac.
I also had this problem, I tried to solve it using LCS, and even sorted it before applying the LCS, but probably do to some quirks, gets AC, until I realize what it asks...
Posted: Fri Dec 20, 2002 12:27 pm
by anupam
its not a problem of lcs.
those who think too much deeper must get wa in the problem.
but according to ..'s advice i revised the prob and got ac.
thanks ..

10252 WA
Posted: Tue Jan 14, 2003 1:04 pm
by deddy one
I got WA for 10252
could anyone tell me what's wrong with my code pls
thx in advance
[cpp] cut------
[/cpp]
I experienced the same problem..
Posted: Fri Jan 17, 2003 12:55 pm
by Whinii F.
from the problem statement we find:
That means in the input file line 1 and 2 is a set of input, line 3 and 4 is a set of input and so on.
The input strings include blank characters. Try using gets() instead of scanf().
Posted: Sat Jan 18, 2003 10:30 am
by deddy one
thx whinii
but I still got WA though

Posted: Fri Feb 21, 2003 8:21 pm
by deddy one
Posted: Tue Feb 25, 2003 2:27 pm
by deddy one
nevermind , I completely misunderstood what the problem really
wants.
got AC now.
10252-- input problem
Posted: Wed Apr 09, 2003 5:50 pm
by route
I tried to use cin.getline for input. Surprisingly, it stops after the blank lines. Why is it ?
Should I just use cin and !cnt.good to terminate the program ?
What makes difference ?
10252 - Common Permutation
Posted: Thu Jun 19, 2003 7:09 pm
by Taneem
input: down
won
output: won or now ?
I am guessing it would be "now" since in the sample second test case ..
input: walking down
output: nw (and not wn)
I am just curious, for some reason I keep getting WA on this problem.
Posted: Fri Jun 20, 2003 7:47 am
by the LA-Z-BOy
output for:
is ...
Greetings
Posted: Fri Jun 20, 2003 7:52 am
by Taneem
thanks LA-Z-Boy. That's what I have too. Just cant figure out why I am not getting AC. it seems like an easy problem to me...
can u please give me some test cases?