Check-in [4c3be66099]
Not logged in
Overview
SHA1 Hash:4c3be660993a5307c58b7d3a73c98ac5d73b5075
Date: 2013-12-05 00:29:40
User: kinaba
Comment:Comment
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified lib/geo/pythagoras.cpp from [6328445c69b877f6] to [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 }