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 的 GGMM

Posted by IceKingdom at 2009-07-14 18:18:25 on Problem 2453
var     x , y   : longint ;
begin
        while (not seekeof) do begin
         readln (x) ;
         if (x = 0) then break ;
         y := x and (-x) ;
         writeln (x + y + ((x xor (x + y)) div y) shr 2) ;
        end ;
end .

这是网上那个牛逼的代码的 Pascal 版 ~
注意 xor 的优先级跟 + - 等同,比 div 要低。。。





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