下面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;
}
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析