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

Please help,I always have WA#1.Thank you very much!!!!!
Posted by CHIDEMYAN SERGEY 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
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by CHIDEMYAN SERGEY 13 May 2007 16:01
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by CHIDEMYAN SERGEY 14 May 2007 17:52
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
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by Alias (Alexander Prudaev) 14 May 2007 18:59
my program writes 0

Edited by author 14.05.2007 18:59
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by CHIDEMYAN SERGEY 14 May 2007 21:21
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
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by Sandro (USU) 16 May 2007 01:21
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.
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by CHIDEMYAN SERGEY 16 May 2007 17:25
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
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by CHIDEMYAN SERGEY 16 May 2007 17:47
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
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by Sandro (USU) 17 May 2007 00:53
Try:
scanf("%d%s%s",&len,s,t);

without gets and cin
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by CHIDEMYAN SERGEY 17 May 2007 19:48
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
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by Sandro (USU) 18 May 2007 11:08
Try test:
3
aab
aba
Re: Please,help!!!All right in my PC,but I always have WA!!!
Posted by CHIDEMYAN SERGEY 18 May 2007 17:53
Thank,thank!!!!!Nice test,now I'll try to correct my algo!!!

Edited by author 18.05.2007 17:54