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 1AC 0MS

Posted by aiouniya at 2012-08-24 10:49:04 on Problem 3219
var
  n,k,m,a,b,c:longint;
begin
  while not eof do
    begin
      readln(n,k);
      m:=n-k;
      a:=0;
      b:=0;
      c:=0;
      while n<>0 do
        begin
          n:=n div 2;
          a:=a+n;
        end;
      while m<>0 do
        begin
          m:=m div 2;
          b:=b+m;
        end;
      while k<>0 do
        begin
          k:=k div 2;
          c:=c+k;
        end;
      if (a-b>c) then writeln(0)
      else writeln(1);
  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