#3956. [GESP202403 七级 C++] 第 13 题
[GESP202403 七级 C++] 第 13 题
下面 count_triple 函数的时间复杂度为( )。
int count_triple(int n) {
int cnt = 0;
for (int a = 1; a <= n; a++)
for (int b = a; a + b <= n; b++)
for (int c = b; a + b + c <= n; c++)
if (a * a + b * b == c * c)
cnt++;
return cnt;
}
{{ select(1) }}