- Vijos
- 2009-02-25 14:56:56 @
type
fly=record
a:array [1..10000] of longint;
b:array [1..10000] of longint;
end;
var
s:fly;
k,n,m,max,t1,p,max1:longint;
procedure f(l,r:integer);
var
i,j,x,y,z:longint;
begin
i:=l;
j:=r;
x:=s.a[(l+r)div 2];
repeat
while s.a[i]x do
dec(j);
if ij;
if i1 then f(1,j);
end;
procedure d(t:integer);
begin
max:=s.b[t];
if (t1+1n)or(s.a[t1+1]>max)
end;
inc(t1);
max1:=max-s.a[t]+max1;
t:=t1;
if t>n then exit else d(t);
end;
begin
readln(n);
for k:=1 to n do
readln(s.a[k],s.b[k]);
f(1,n);
t1:=1;
d(1);
writeln(max1);
end.
哪位大牛能帮我找一下错误
0 条评论
目前还没有评论...