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

Posted by gongenhao at 2007-04-30 19:15:01 on Problem 3219
program pku3219;
  var
    i,j,k,n,m,s:longint;
  function bi(u:longint):longint;
    var
      v,w:longint;
    begin
      w:=0;
      while (u mod 2=0) and (u>0) do begin
        inc(w);
        u:=u div 2;
      end;
      exit(w);
    end;
  begin
    while not seekeof(input) do begin
      readln(n,k);
      s:=bi(n)-bi(k)-bi(n-k);
      if s>0 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