Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

找不出任何可能RE的地方了,大牛帮忙啊~

Posted by realmajia at 2005-05-28 22:51:25 on Problem 2236
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator