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

今天做题不爽啊,有WA一道,有什么Trick?

Posted by JiangLY at 2005-06-04 00:14:53 on Problem 2160
var
  m:array[1..6,1..2] of integer;
  f:array[1..6] of boolean;
  i,j,k:integer;
  y:boolean;
begin
  while not eof do
    begin
      for i:=1 to 6 do
        begin
          readln(m[i,1],m[i,2]);
          if m[i,1]>m[i,2] then
            begin
              k:=m[i,1];
              m[i,1]:=m[i,2];
              m[i,2]:=k;
            end;
        end;
      fillchar(f,sizeof(f),false);
      for i:=1 to 6 do
        if not f[i] then
          for j:=i+1 to 6 do
            if not f[j] then
              begin
                f[i]:=true;
                f[j]:=true;
                break;
              end;
      y:=true;
      for i:=1 to 6 do
        if not f[i] then
          begin
            y:=false;
            break;
          end;
      if y then writeln('POSSIBLE')
           else writeln('IMPOSSIBLE');
    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