ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1423. String Tale

CHIDEMYAN SERGEY Please help,I always have WA#1.Thank you very much!!!!! [11] // Problem 1423. String Tale 12 May 2007 18:51
[code deleted]

Edited by author 14.05.2007 17:50

Edited by author 14.05.2007 17:53

Edited by author 14.05.2007 17:55
CHIDEMYAN SERGEY Re: Please,help!!!All right in my PC,but I always have WA!!! [10] // Problem 1423. String Tale 13 May 2007 16:01
Please,give me test#2!!!I can't understand where is my mistake?
What answer is right for this test:
1
a
a
answer:
0
or
answer:
-1
Thank you VERY Much!!!!!



Edited by author 14.05.2007 17:54

Edited by author 14.05.2007 17:54
Alias (Alexander Prudaev) Re: Please,help!!!All right in my PC,but I always have WA!!! [8] // Problem 1423. String Tale 14 May 2007 18:59
my program writes 0

Edited by author 14.05.2007 18:59
Thank!!!Sorry,if you can,please give me test#1 & test#2 or some test,where in your opinion I could be wrong;I really don't understand why I always have wa#1!!!Thank you!!!

Edited by author 14.05.2007 21:23

Edited by author 14.05.2007 21:25
Test #1 is a sample test from the problem statement. Try to input data using stdio only or using iostream only, because your code works differently in the different compilers.
Thank,but I used only <iostream.h> with functions cin,cout.And for input strings I used gets function.
In this tests my program output:
1
a
a
ans:0
1
a
b
ans:-1
2
aa
aa
ans:0
2
as
sa
ans:1
2
as
ad
ans:-1
and finnaly for test
11
abracadabra
racadabraab
ans:9
I tried to change gets to cin & now I have WA#4
Thank you very much for attention!!!

Edited by author 16.05.2007 17:30

Edited by author 16.05.2007 17:30

Edited by author 16.05.2007 17:32

Edited by author 16.05.2007 17:34

Edited by author 16.05.2007 17:35

Edited by author 16.05.2007 17:40

Edited by author 16.05.2007 17:42
Sorry,for test:
4
asde
ased
ans:-1
I think it right,isn't it?


Edited by author 16.05.2007 17:51

Edited by author 16.05.2007 17:55

Edited by author 16.05.2007 17:56
Try:
scanf("%d%s%s",&len,s,t);

without gets and cin
Thank a lot!!!I have one more question:if you can please give me example of test#4,because I still have WA#4.It will help me to correct my algo!
Thank a lot!!!

Edited by author 17.05.2007 19:58
Try test:
3
aab
aba
Thank,thank!!!!!Nice test,now I'll try to correct my algo!!!

Edited by author 18.05.2007 17:54