| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
哪位大哥帮看下pku1019为什么超时var
n,k,m,q,i:longint;
procedure main;
begin
i:=0;
while k<n do
begin
inc(i);
k:=k+i;
end;
end;
begin
readln(m);
q:=0;
while q<m do
begin
inc(q);k:=0;
readln(n);
main;
writeln(n-((i*(i-1)) div 2));
end;
end.
PS:pku1019的题目,PASCAL语言,我不知道还能怎么优化了,哪位大侠帮帮忙!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator