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

Общий форум

Where is it wrong? (Problem 10)
Послано Barnaul_School#42_2 16 окт 2004 16:58
{$N+}
var
 n: extended;
 k: extended;

begin
 readln(n);
 k:=n*n;
 writeln (k:0:0);
 writeln (n:0:0);
end.
Re: Where is it wrong? (Problem 10)
Послано Hiep Q. Dinh 16 окт 2004 17:31
rounding value :) you should do the calculating with big integers manually ;)
Re: Where is it wrong? (Problem 10)
Послано Saturn (HUS) 16 окт 2004 18:21
I got AC with extended, so I don't think that we need big integers to solve this problem
Re: Where is it wrong? (Problem 10)
Послано gufy 16 окт 2004 20:56
I had literally the same program and WA #12. though I'm sure that I won't be out of extended!

see, (N^2)^2/N^3=N, therefore the solution is correct. moreover, the input data can't be more than 10^9, so N^2<=10^18 which is OK for extended.

Maybe 'tis just one more difference between Turbo Pascal and Free Pascal
Re: Where is it wrong? (Problem 10)
Послано gufy 17 окт 2004 19:59
The problem has been in FreePascal, of course. In both TP70 and Delphi, it is OK, but at Timus you need to use the type int64, which exists only in Delphi and FreePascal, but not in TP70. BTW, it is an integral type, so you don't need to output N:0:0, but simply N. обидно, блин

Edited by author 17.10.2004 20:01