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

pascal的注意了,每行读完了要readln,不然就WA

Posted by wukewen at 2014-04-28 00:24:14 on Problem 2575
var
  a,b:array[0..10000] of longint;
  n,i,t:longint;
  f:boolean;
begin
  while not eof do
    begin
    read(n);
    for i:=1 to n do read(a[i]);
    readln;
    fillchar(b,sizeof(b),0);
    f:=true;
    for i:=2 to n do
      begin
      t:=abs(a[i]-a[i-1]);
      if (t>=n)or(t=0)or(b[t]=1) then
         begin f:=false; break; end;
      b[t]:=1;
      end;
    if f then writeln('Jolly') else writeln('Not jolly');
    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