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

大家帮我看看,Why WA?(PASCAL)

Posted by wy54224 at 2011-02-11 22:06:54 on Problem 2470
var a:array[1..100005]of longint;
    n,i,bj:integer;
begin
 readln(n);
 while n<>0 do
 begin
  bj:=1;
  for i:=1 to n do read(a[i]);readln;
  for i:=1 to n do
   if a[a[i]]<>i then begin bj:=0;break;end;
  if bj=0 then writeln('not ambiguous')
          else writeln('ambiguous');
  readln(n);
 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