Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:为什么WA?In Reply To:为什么WA? Posted by:paddy at 2010-07-05 11:11:49 > var > a,b,lcm,gcd,t,s,i:int64; > > function pp(x,y:int64):boolean; > var > temp:int64; > begin > while x mod y<>0 do begin > temp:=x mod y; > x:=y; > y:=temp; > end; > if y=1 then pp:=true else pp:=false; > end; > > begin > readln(gcd,lcm); > t:=lcm div gcd; > i:=trunc(sqrt(t)); > while i>=1 do begin > if (t mod i=0) and pp(t div i,i) then begin > a:=i*gcd; b:=(t div i)*gcd; > writeln(a,' ',b); > halt; > end; > dec(i); > end; > end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator