下面 count_triple 函数的时间复杂度为( )。
1 int count_triple(int n) { 2 int cnt = 0; 3 for (int a = 1; a <= n; a++) 4 for (int b = a; a + b <= n; b++) 5 for (int c = b; a + b + c <= n; c++) 6 if (a * a + b * b == c * c) 7 cnt++; 8 return cnt; 9 }
O(N)
O(N2)
O(N3)
O(N4)