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 1120. Sum of Sequential Numbers

Why I got 'FLT_INVALID_OPERATION' ?
Posted by Tang RZ 14 Jul 2004 09:25
This is my program:

var
  a,temp,n,p:longint;

begin
  read(n);
  temp:=round((-1+trunc(sqrt(1+8n))+1)/2);
  for p:=temp downto 1 do
    if trunc(((2*n/p)-p+1)/2)=(((2*n/p)-p+1)/2) then
      begin
        a:=trunc(((2*n/p)-p+1)/2);
        writeln(a,' ',p);
        halt;
      end;
  writeln(n,' ',1);
end.

What's wrong? Can you help me?

Edited by author 14.07.2004 09:46
Re: Why I got 'FLT_INVALID_OPERATION' ?
Posted by Tang RZ 16 Jul 2004 06:11
I got AC.