Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Why wa>

Posted by mayakovsky at 2004-10-22 22:01:51 on Problem 1844
program qiuhe;
var n,delta,i,x,t:integer;
begin
readln(n);
delta:=round(sqrt(8*n+1));
x:=round((delta-1)/2);i:=(x*x+x) div 2;
if i=n then writeln(x)
else
begin
repeat
x:=x+1;
i:=i+x;
until (i>n) and (not odd(i-n));
writeln(x);
end;
end.

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator