记录编号 | 79459 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 1417.[NOIP 2001]最大公约数和最小公倍数问题 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | Pascal | 运行时间 | 0.112 s | ||
提交时间 | 2013-11-05 19:24:42 | 内存使用 | 0.17 MiB | ||
program P1417; var x,y,i,j,sum:longint; function gcd(x,y:longint):longint; begin if x mod y=0 then exit(y) else gcd:=gcd(y,x mod y); end; begin assign(input,'gcdpro.in'); reset(input); assign(output,'gcdpro.out'); rewrite(output); read(x,y); for i:=x to y do if (i mod x=0)and(y mod i=0) then for j:=x to y do if (j mod x=0)and(y mod j=0) then begin if (gcd(i,j)=x)and(i div gcd(i,j)*j=y) then inc(sum ); end; writeln(sum); end.