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

哼!NOI前都不让我过!把程序放在这儿,明天到了郑州再干掉它!

Posted by Failed_JiangLY at 2005-08-04 22:29:09 on Problem 1147
In Reply To:为什么RE??? Posted by:JiangLY at 2005-08-04 22:20:32
var
  t,s:array[1..3000] of longint;
  a,b,i,k,n:longint;
begin
  readln(n);
  a:=0;
  b:=0;
  for i:=1 to n do
    begin
      read(s[i]);
      if s[i]=0 then inc(a)
                else inc(b);
    end;
  readln;
  k:=0;
  i:=1;
  if a<>0 then
    begin
      repeat
        while s[i]<>0 do inc(i);
        inc(i);
        inc(k);
        t[k]:=i;
      until k=a;
    end;
  i:=1;
  if b<>0 then
    begin
      repeat
        while s[i]<>1 do inc(i);
        inc(i);
        inc(k);
        t[k]:=i;
      until k=n;
    end;
  for i:=1 to n do write(s[t[i]],' ');
  writeln;
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