| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
找不出任何可能RE的地方了,大牛帮忙啊~var
s:array[1..1001] of boolean;
w:array[1..1001,1..2] of longint;
map:array[1..1001,1..1001] of boolean;
i,j,k,n,a,b,d:longint;
t,last:char;
begin
readln(n,d);
for i:=1 to n do readln(w[i,1],w[i,2]);
while not seekeof do
begin
read(t);
while t=' ' do read(t);
if t='O' then
begin
readln(a);
if not s[a] then
begin
s[a]:=true;
for i:=1 to n do
if sqrt(sqr(w[i,1]-w[a,1])+sqr(w[i,2]-w[a,2]))<=d then
begin
map[a,i]:=true;
map[j,a]:=true;
end;
end;
end
else
begin
readln(a,b);
if last<>t then
begin
for k:=1 to n do
if s[k] then
for i:=1 to n do
if s[i] then
if map[i,k] then
for j:=1 to n do
if s[j] then
if map[k,j] then
begin
map[i,j]:=true;
map[j,i]:=true;
end;
end;
if map[a,b] then writeln('SUCCESS')
else writeln('FAIL');
end;
last:=t;
end;
end.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator