Diff
Not logged in

Differences From Artifact [6328445c69b877f6]:

To Artifact [395c6eb448780702]:


> 1 > 2 //------------------------------------------------------------- 1 // Enumerate coprime pythagoras triangles 3 // Enumerate coprime pythagoras triangles > 4 // > 5 // Verified by > 6 // - SRM 599 Div1 LV2 > 7 //------------------------------------------------------------- > 8 2 9 3 for(int m=1;; ++m) 10 for(int m=1;; ++m) 4 for(int n=1; n<m; ++n) if(((m^n)&1) && gcd(m,n)==1) 11 for(int n=1; n<m; ++n) if(((m^n)&1) && gcd(m,n)==1) 5 { 12 { 6 int a = m*m-n*n, b = 2*m*n, c = m*m+n*n; 13 int a = m*m-n*n, b = 2*m*n, c = m*m+n*n; 7 if(a>b) swap(a,b); 14 if(a>b) swap(a,b); 8 } 15 }