方程ax+by+c=0; 问有多少对x,y. 满足 x1<=x<=x2, y1<=y<=y2ax+by=-c. c=-c,后, 扩展欧几里得求一下,x,y;x,y满足 ax+by=gcd(a,b);x*=c/gcd(a,b);y*=c/gcd(a,b);后x,y满足 ax+by=c;通解:x0=x+k*b/gcd(a,b);y0=y-k*
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号