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

Discussion of Problem 1209. 1, 10, 100, 1000...

Test 3 crash - floating-point invalid operation
Posted by SemenB 7 Jan 2013 00:51
Please help
Why am I getting floating-point invalid operation on test 3?
Would it be possible to see the test values?

program pr_1;
var n, i, x: longint;
a: real;
begin
read(n);
for i:=1 to n do
begin
  read(x);
  a:= (1 + sqrt(8*x-7))/2;
  if (Frac(a) = 0.0) then
    write('1 ')
  else
    write('0 ');
end;
end.