diff --git a/1925. Count Square Sum Triples b/1925. Count Square Sum Triples new file mode 100644 index 0000000..84e1a51 --- /dev/null +++ b/1925. Count Square Sum Triples @@ -0,0 +1,34 @@ +class Solution { +public: + static int GCD(unsigned x, unsigned y){ + const int bx=countr_zero(x), by=countr_zero(y); + const int bb=min(bx, by); + x>>=bx, y>>=by; + for(unsigned r; y; y=min(y, r)){ + r=x%y; + x=exchange(y, r); + } + return x<n) break; + + // k multiples: ka, kb, kc + int kmax=n/c; + // count (a,b,c) and (b,a,c) + cnt+=2*kmax; + } + } + return cnt; + } +};