What is acmsguru in codeforces?
Nonetheless, Codeforces team is regularly asked to revive acmsguru, since there is still a lot of interest in the problemset. I think I have been just randomly practicing from codeforces to topcoder to SPOJ to GCJ. You may give the category/type or hint or algorithm/data structure needed to solve the problem in spoiler. And what do you mean by Codeforces problems? While CF rounds are not so diverse, you have several hundred contests available in gym,.
Can anyone hel me? I got WA 20. I used linear Diophantine equation and extended Euclidian algorithms from cp-algorithms.com, but I got WA. These are links that I used:
My code is :
#include using namespace std; ll gcd(ll a,ll b,ll &x,ll &y)
{
if(a==0)
{
x=0;
y=1;
return b;
}
ll x1,y1;
ll d=gcd(b%a,a,x1,y1);
x=y1-(b/a)*x1;
y=x1;
return d;
} bool find_any_solution(ll a,ll b,ll c,ll &x0,ll &y0,ll &g)
{
g=gcd(abs(a),abs(b),x0,y0);
if(c%g)
return false;
x0*=c/g;
y0*=c/g;
if(a<0)
x0=-x0;
if(b<0)
y0=-y0;
return true;
} void shift_solution(ll &x,ll &y,ll a,ll b,ll cnt)
{
x+=cntb;
y-=cnta;
} PII find_all_solution(ll a,ll b,ll c,ll minx,ll maxx,ll miny,ll maxy)
{
ll x,y,g;
PII res= {-1,-1};
if(!find_any_solution(a,b,c,x,y,g))
return res;
a/=g;
b/=g; }
Related Questions
No More Questions available at this moment!