Can anyone give any critical output or hint on this. And what should be output for this:
5
pele
pele
jkl
jkl
dfg
dag
bad
bcd
My output are:
No
No
No
No
No
And can anybody explain the problem description:"a name which can be obtained by replacing zero or more vowels by other vowels to obtain a new name are considered same, provided they have same length". Considering this at first my program gave output "Yes" for 4th input and "No" for 5th input. Looking forward to ur reply.
Last edited by Mohsin Reza Razib on Tue Oct 27, 2009 12:55 pm, edited 1 time in total.
Mohsin Reza "The tragedy of life does not lie in not reaching your goal. The tragedy lies in having no goal to reach".- Benajamin Mays
Thanks Mr. r2ro. I got it accepted. That was so nice of you. I still have complaints about problem specification "a name which can be obtained by replacing zero or more vowels by other vowels to obtain a new name are considered same"
It should be like : "a name which can be obtained by replacing ONE or more vowels by other vowels to obtain a new name are considered same".
Because for input:
dfg
dag
output should be "Yes" if some one follow the problem specification strictly. I got confused there.
Thanks & Regards
Mohsin
Mohsin Reza "The tragedy of life does not lie in not reaching your goal. The tragedy lies in having no goal to reach".- Benajamin Mays
Mohsin Reza Razib wrote:I still have complaints about problem specification "a name which can be obtained by replacing zero or more vowels by other vowels to obtain a new name are considered same"
It should be like : "a name which can be obtained by replacing ONE or more vowels by other vowels to obtain a new name are considered same".
Because for input:
dfg
dag
output should be "Yes" if some one follow the problem specification strictly. I got confused there.
@Razib: I do not think so, if anyone follows the problem he will find that 'f' is not a vowel. So, no question arise to replace it with anything!
If the input were:
dug
dfg
then the same thing occurs. 'u' is a vowel, so it can be replaced but 'f' is not a vowel so 'u' can't be replaced with 'f'!so, if you follow the instruction, the output should be "No" in both cases. obviously your statement is a bit more clear .
Mohsin Reza Razib wrote:I still have complaints about problem specification "a name which can be obtained by replacing zero or more vowels by other vowels to obtain a new name are considered same"
It should be like : "a name which can be obtained by replacing ONE or more vowels by other vowels to obtain a new name are considered same".
Because for input:
dfg
dag
output should be "Yes" if some one follow the problem specification strictly. I got confused there.
@Razib: I do not think so, if anyone follows the problem he will find that 'f' is not a vowel. So, no question arise to replace it with anything!
If the input were:
dug
dfg
then the same thing occurs. 'u' is a vowel, so it can be replaced but 'f' is not a vowel so 'u' can't be replaced with 'f'!so, if you follow the instruction, the output should be "No" in both cases. obviously your statement is a bit more clear .
But consider the case:
dfg
dug
Here 'f' is not a vowel, so that zero vowel at position 2. As we recall from problem specification "a name which can be obtained by replacing zero or more vowels by other vowels", it should be replaced by a vowel like 'u'. So as i get output should be "Yes". Similarly,
jkl
aeu
output should be: "Yes". But for
jkl
aeb
should be: "No". AS 'l' is not replaced by a vowel. Anyway it over now . But problem specification should be clear.
Mohsin Reza "The tragedy of life does not lie in not reaching your goal. The tragedy lies in having no goal to reach".- Benajamin Mays
Apo, Kemon achen? I hear your name from my university's elder brother. Actually I am a new coder I joined Uva at 06-06-2011. So, I can not understand well of your code. So, I give my simple AC code of 11713 and my rank is 170 and Time is 0.004. I will delete my code after your response.......................Shahadat
Remove This part of your program
if(strlen(s1)==0 && strlen(s2)==0)
{ printf("Yes\n"); // don't print Yes
continue; // don't continue
}
that means if null string or character is given it's nothing that means no '\n' . But, in your program when I input 2 (number of test cases) and press Enter four times your program is terminated, but, never terminated in that case. When strlen is zero it's also nothing don't print 'Yes' .