ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1423. Басня о строке

Please help,I always have WA#1.Thank you very much!!!!!
Послано CHIDEMYAN SERGEY 12 май 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!!!
Послано CHIDEMYAN SERGEY 13 май 2007 16:01
Re: Please,help!!!All right in my PC,but I always have WA!!!
Послано CHIDEMYAN SERGEY 14 май 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!!!
Послано Alias (Alexander Prudaev) 14 май 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!!!
Послано CHIDEMYAN SERGEY 14 май 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!!!
Послано Sandro (USU) 16 май 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!!!
Послано CHIDEMYAN SERGEY 16 май 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!!!
Послано CHIDEMYAN SERGEY 16 май 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!!!
Послано Sandro (USU) 17 май 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!!!
Послано CHIDEMYAN SERGEY 17 май 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!!!
Послано Sandro (USU) 18 май 2007 11:08
Try test:
3
aab
aba
Re: Please,help!!!All right in my PC,but I always have WA!!!
Послано CHIDEMYAN SERGEY 18 май 2007 17:53
Thank,thank!!!!!Nice test,now I'll try to correct my algo!!!

Edited by author 18.05.2007 17:54