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

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

Samsonov Alex [USU] Hint about test 12 [19] // Задача 1074. Очень короткая задача 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.
{AESC USU} Dembel Re: Hint about test 12 [5] // Задача 1074. Очень короткая задача 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
Samsonov Alex [USU] Re: Hint about test 12 [4] // Задача 1074. Очень короткая задача 21 янв 2007 15:49
Check your mail.
CWAC Re: Hint about test 12 [2] // Задача 1074. Очень короткая задача 2 фев 2007 20:48
I also have WA on test #12. Could you tell me what about scanf (cwac@hackermail.com)
{AESC USU} Evgeny Kurpilyanskij Re: Hint about test 12 [1] // Задача 1074. Очень короткая задача 3 фев 2007 00:11
check your mail
Thanks!
deLarry Re: Hint about test 12 // Задача 1074. Очень короткая задача 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!
Eng1neer Re: Hint about test 12 [11] // Задача 1074. Очень короткая задача 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.
Samsonov Alex [USU] Re: Hint about test 12 [10] // Задача 1074. Очень короткая задача 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
Eng1neer Re: Hint about test 12 [5] // Задача 1074. Очень короткая задача 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?
Samsonov Alex [USU] Re: Hint about test 12 [4] // Задача 1074. Очень короткая задача 28 фев 2007 18:34
Yes, it's incorrect indeed. My bug :)
Eng1neer Re: Hint about test 12 [3] // Задача 1074. Очень короткая задача 28 фев 2007 19:49
Thanks for info anyway.
PieceOfMeat Some testing [2] // Задача 1074. Очень короткая задача 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
Mr_Ffloyd Re: Some testing // Задача 1074. Очень короткая задача 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
IgorKoval(from Pskov) Re: Some testing // Задача 1074. Очень короткая задача 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
I used
cin >> N; gets(s);
instead of
scanf("%d\n", &N);
and got AC :)
Boyan Lazov Re: Hint about test 12 [2] // Задача 1074. Очень короткая задача 15 сен 2008 18:56
Also,
-0.0000010e+6
0
-1

(got me on test 12 and isn't mentioned here)
SkorKNURE Hint about test 12 [1] // Задача 1074. Очень короткая задача 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
Akaishuichi Re: Hint about test 12 // Задача 1074. Очень короткая задача 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
sich_off (ONPU) Re: Hint about test 12 // Задача 1074. Очень короткая задача 18 апр 2009 08:48
I had a stupid error...
test:
12.
2
#

my program`s output was 12.00, should be NAN.