Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
サイズ n の配列があります。特定の番号を持つ各要素の GCD を見つける必要があり、それが 1 より大きい場合は、別の配列に追加します。これを行う最速の方法は何ですか?
int gcd(int a, int b) { if(b == 0) { return a; } else { return gcd(b, a % b); } }