水题,直接模拟:
{
Author:wzx961008
Problem:UVa 10302-Summation of Polynomials
Verdict:Accepted
Language:PASCAL
Run Time:0.096s
Submission Date:2011-02-11 03:39:05
}
var n:longint;
ans,i:qword;
f:array[1..50000]of qword;
begin
while not eof do begin
readln(n);
ans:=0; i:=0;
while i<n do begin
inc(i);
if f[i]=0 then f[i]:=i*i*i;
ans:=ans+f[i];
end;
writeln(ans);
end;
end.