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

Common Board

Where is it wrong? (Problem 10)
Posted by Barnaul_School#42_2 16 Oct 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)
Posted by Hiep Q. Dinh 16 Oct 2004 17:31
rounding value :) you should do the calculating with big integers manually ;)
Re: Where is it wrong? (Problem 10)
Posted by Saturn (HUS) 16 Oct 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)
Posted by gufy 16 Oct 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)
Posted by gufy 17 Oct 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