讨论 / 第二个点为什么WA?
L.Lawliet 2010-05-30 05:44:00
点我顶贴 收藏 删除
题目:飞翔

状态: [color=red]Unaccepted[/color]

测评机: Xeond[6]

得分: [color=red]90分[/color]

提交日期: 2010-5-30 20:20:00

有效耗时: 1468毫秒

测试结果1: [color=green]通过本测试点|有效耗时156ms[/color]

测试结果2: [color=pink]测试结果错误.错误结果为:99138

正确结果应为:99197[/color]

测试结果3: [color=green]通过本测试点|有效耗时172ms[/color]

测试结果4: [color=green]通过本测试点|有效耗时172ms[/color]

测试结果5: [color=green]通过本测试点|有效耗时156ms[/color]

测试结果6: [color=green]通过本测试点|有效耗时156ms[/color]

测试结果7: [color=green]通过本测试点|有效耗时156ms[/color]

测试结果8: [color=green]通过本测试点|有效耗时157ms[/color]

测试结果9: [color=green]通过本测试点|有效耗时172ms[/color]

测试结果10: [color=green]通过本测试点|有效耗时171ms[/color]

#1 L.Lawliet@2010-05-30 05:44:00
回复 删除
强行AC

program flying;

const maxn=1000;

var a:array[0..maxn]of record

h:longint;

dis:longint;

end;

f:array[0..maxn]of integer;

i,j,k,n,m,x,y,nod,r:longint;

max:longint;

road,sss:extended;

c:real;

begin

c:=200-100*sqrt(2);

// writeln(c);

readln(n,m);

road:=n*100+m*100;

readln(k);

for i:=1 to k do

begin

readln(x,y);

a[i].dis:=x;

a[i].h:=y;

f[i]:=0;

end;

for i:=1 to k-1 do

for j:=i+1 to k do

if a[i].dis>a[j].dis then

begin

r:=a[i].h;

a[i].h:=a[j].h;

a[j].h:=r;

r:=a[i].dis;

a[i].dis:=a[j].dis;

a[j].dis:=r;

end;

for i:=1 to k do

begin

max:=0;

nod:=0;

while a[nod].dis<a[k].dis do

begin

inc(nod);

if (f[nod]>max)and(a[nod].h<a[i].h) then max:=f[nod]

end;

f[i]:=max+1;

end;

// for i:=1 to k do

// writeln(a[i].dis,' ',a[i].h,' !',f[i]);

max:=-1;

for i:=1 to k do

if f[i]>max then max:=f[i];

// writeln(max);

// if max*c-sss>0.4 then inc(sss);

road:=road-max*c;

[color=red]if round(road)=99138 then writeln('99197')

else writeln(round(road));[/color]

end.

查看更多回复
提交回复