2010niop普及组复赛导弹拦截 请高手帮我检测我这道题是否正确(程序有没错,时间有没超)var x1,x2,y1,y2,i,j,ans1,ans2,n:longint;a:array[1..100000,1..2] of integer;c:boolean;function min(a,b:longint):longint;beginif a>b t

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 12:42:05
2010niop普及组复赛导弹拦截 请高手帮我检测我这道题是否正确(程序有没错,时间有没超)var x1,x2,y1,y2,i,j,ans1,ans2,n:longint;a:array[1..100000,1..2] of integer;c:boolean;function min(a,b:longint):longint;beginif a>b t
xTn@`~$6&5kǘniEIFJQEV%!-M~]ݵ )jz>xg~!8nw, q]5sdEBQ|㨫HMVrBLؙٖǐ/E UNT h"$9TfzؒZj]s-uUb>? +i!N qZ|IV2a6 d{杸Q:Nc9 Y5WN' )3oZV[{qik1 Gsc|hhEgN_}!r4m//ZCSY p`M+,r4l

2010niop普及组复赛导弹拦截 请高手帮我检测我这道题是否正确(程序有没错,时间有没超)var x1,x2,y1,y2,i,j,ans1,ans2,n:longint;a:array[1..100000,1..2] of integer;c:boolean;function min(a,b:longint):longint;beginif a>b t
2010niop普及组复赛导弹拦截 请高手帮我检测我这道题是否正确(程序有没错,时间有没超)
var x1,x2,y1,y2,i,j,ans1,ans2,n:longint;
a:array[1..100000,1..2] of integer;
c:boolean;
function min(a,b:longint):longint;
begin
if a>b then min:=b
else min:=a;
if min=b then c:=false;
end;
function max(a,b:longint):longint;
begin
if a>b then max:=a
else max:=b;
end;
function ju(a1,a2,b1,b2,c1,c2:integer):longint;
var q,p:longint;
begin
q:=(a1-b1)*(a1-b1)+(a2-b2)*(a2-b2);
p:=(a1-c1)*(a1-c1)+(a2-c2)*(a2-c2);
ju:=min(q,p);
end;
begin
read(x1,x2,y1,y2);//此处定义与题目不同,认真看
read(n);
for i:=1 to n do
begin
c:=true;
read(a[i,1],a[i,2]);
j:=ju(a[i,1],a[i,2],x1,x2,y1,y2);
if c then ans1:=max(ans1,j)
else ans2:=max(ans2,j);
end;
write(ans1+ans2);
end.

2010niop普及组复赛导弹拦截 请高手帮我检测我这道题是否正确(程序有没错,时间有没超)var x1,x2,y1,y2,i,j,ans1,ans2,n:longint;a:array[1..100000,1..2] of integer;c:boolean;function min(a,b:longint):longint;beginif a>b t
看的不是太懂.一楼很好笑啊,自己找数据¥

自己找测试数据测啊