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

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

Hint about test 12
Послано Samsonov Alex [USU] 18 янв 2007 20:41
You have to be very careful with scanf. It is wrong to write something like "scanf("%d\n", &n);" It took me a month to find this bug.
Re: Hint about test 12
Послано {AESC USU} Dembel 21 янв 2007 11:08
Samsonov Alex [USU] писал(a) 18 января 2007 20:41
You have to be very careful with scanf. It is wrong to write something like "scanf("%d\n", &n);" It took me a month to find this bug.
To Samsonov Alex: why?
please write answer(my mail Dembel12006@yandex.ru)

Edited by author 21.01.2007 14:25
Re: Hint about test 12
Послано Samsonov Alex [USU] 21 янв 2007 15:49
Check your mail.
Re: Hint about test 12
Послано CWAC 2 фев 2007 20:48
I also have WA on test #12. Could you tell me what about scanf (cwac@hackermail.com)
Re: Hint about test 12
Послано {AESC USU} Evgeny Kurpilyanskij 3 фев 2007 00:11
check your mail
Re: Hint about test 12
Послано CWAC 3 фев 2007 12:59
Thanks!
Re: Hint about test 12
Послано Eng1neer 27 фев 2007 18:16
Like many others I also got wa#12. Can you mail me (rddvl@mail.ru) this info about scanf? Thankful in advance.
Re: Hint about test 12
Послано Samsonov Alex [USU] 27 фев 2007 23:09
Oh, god :)
I should better write it here. The thing is that if you use scanf("%d\n", &N);
it reads not only number N and line break but also all whitespace characters after this linebreak. So, for example, it is possible that your program fails here:

//some number
3
_1.e6//Space at the beginning of the line
3

It can say that ' 1.e6' is a correct number.

Edited by author 27.02.2007 23:10

Edited by author 27.02.2007 23:10
Re: Hint about test 12
Послано Eng1neer 28 фев 2007 00:55
Thanks a lot, but this situation is correctly processed in my program. But I have another question. Is number "1.e6" correct ? I'm talking about it's fractional part. According to problem's notation there shouldn't be numbers with decimal point and without fractional part. What can you say about this?
Re: Hint about test 12
Послано Samsonov Alex [USU] 28 фев 2007 18:34
Yes, it's incorrect indeed. My bug :)
Re: Hint about test 12
Послано Eng1neer 28 фев 2007 19:49
Thanks for info anyway.
Some testing
Послано PieceOfMeat 19 мар 2007 00:10
some tests:
carefully check your program behavior

-0.00
0
0

0.000e00000
0
0

0.00
5
0.00000

1e000000000000000000000000000000000012
3
1000000000000.000

-1e-12345678910111213141516
5
0.00000

-1.e-12
3
Not a floating point number

123.23e-12.4
0
Not a floating point number

-.12e4
2
-1200.00

123.3e0
12
123.300000000000

12.2e-10
5
0.00000

12.2e+10
3
122000000000.000

12 e3
21
Not a floating point number
Re: Some testing
Послано Mr_Ffloyd 16 апр 2007 19:18
I fixed all bugs, that i found in forum, but i still got WA on f---g test 12. Anybody! Help me!
Mail: mr_ffloyd@mail.ru

Edited by author 16.04.2007 19:19
Re: Hint about test 12
Послано A 18 июл 2007 15:06
I used
cin >> N; gets(s);
instead of
scanf("%d\n", &N);
and got AC :)
Re: Hint about test 12
Послано Boyan Lazov 15 сен 2008 18:56
Also,
-0.0000010e+6
0
-1

(got me on test 12 and isn't mentioned here)
Hint about test 12
Послано SkorKNURE 23 окт 2008 08:40
Maybe someone has already written about it, but I didn't find.

!!--BE CAREFUL:--!!

Test 12 is correct, it has big exponent part like
2E100000000000
10

and answer would look like
0.00..000
Re: Hint about test 12
Послано deLarry 17 ноя 2008 18:19
I have too ... wa12

i have tested all line on wrong simb..
on e>500 ...
on
#100...

can somebody help me...

de10@rambler.ru

big s!
Re: Hint about test 12
Послано sich_off (ONPU) 18 апр 2009 08:48
I had a stupid error...
test:
12.
2
#

my program`s output was 12.00, should be NAN.
Re: Hint about test 12
Послано Akaishuichi 20 май 2009 21:32
the right answer should be 2<many zeros>.<10 zeros>
but as it's granted that the output will not exceed 200 symbols, i don't think there will happen to be such inputs.
or the maximum output can be a too long to deal with.

>>Posted by SkorKNURE October 23, 2008 08:40
>>
>>Maybe someone has already written about it, but I didn't >>find.
>>
>>!!--BE CAREFUL:--!!
>>
>>Test 12 is correct, it has big exponent part like
>>2E100000000000
>>10
>>
>>and answer would look like
>>0.00..000

Edited by author 20.05.2009 21:33
Re: Some testing
Послано IgorKoval(from Pskov) 8 янв 2012 05:40
Power can be vary big: as positive as negative! But "It is guaranteed that a length of a result will not exceed 200 symbols."

Very good test:
0.0e+1212121332233333333
2
#

0e1212121332233333333
2
#

answer: 0.00 =)

PS: thank you, PieceOfMeat ! Good test! You have helped me!

Edited by author 08.01.2012 05:41

Edited by author 08.01.2012 05:41