/ Vijos / 讨论 / 分享 /

P1094

read(t);

num[t]:=num[t]+1;

b[i]:=maxlongint;

END;

p:=0;

for i:=1 to 20000 do

for j:=1 to num[i] do

begin

p:=p+1;

a[p]:=i;

end;

p:=0;

x:=1;

y:=1;

ans:=0;

for i:=1 to n-1 do

begin

min:=maxlongint;

if(a[x]+a[x+1]

2 条评论

  • @ 2009-07-17 21:40:50

    更正

    应为P1097

  • @ 2009-07-17 16:17:09

    程序没显示完

    VAR

    a,b:ARRAY[1..10002]OF longint;

    i,j,n,p,t,x,y,min,method,ans:longint;

    num:ARRAY[1..20000]OF integer;

    BEGIN

    readln(n);

    fillchar(num,sizeof(num),0);

    For i:=1 to n do

    BEGIN

    read(t);

    num[t]:=num[t]+1;

    b[i]:=maxlongint;

    END;

    p:=0;

    for i:=1 to 20000 do

    for j:=1 to num[i] do

    begin

    p:=p+1;

    a[p]:=i;

    end;

    p:=0;

    x:=1;

    y:=1;

    ans:=0;

    for i:=1 to n-1 do

    begin

    min:=maxlongint;

    if(a[x]+a[x+1]

  • 1