Search found 2 matches

by Hehe
Sun Dec 23, 2001 3:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10104 - Euclid Problem
Replies: 29
Views: 15617

10104 - Euclid Problem

What's wrong with this program?
Can any one help me?

[pascal]program u10104;
var
a,b,a0,b0,d,e,f,q,r,x,y,x1,x2,y1,y2:longint;
begin
while not eof do begin
readln(a,b);
a0:=a; b0:=b;
{a*x+b*y=d, d=gcd(a,n)=1}
x2:=1; x1:=0; y2:=0; y1:=1;
while b>0 do begin
q:=a div b;
r:=a-q*b;
x:=x2-q*x1 ...
by Hehe
Tue Dec 18, 2001 8:11 am
Forum: Volume 102 (10200-10299)
Topic: 10214 - Trees in a Wood.
Replies: 5
Views: 2941

10214 - Trees in a Wood.

I find this problem quite interesting,
but I haven't found a very good solution.
peng du, can you explain me the amazing 0.08 sec, 64K solution?

Go to advanced search