#14007. [GESP202609 四级 C++] 第 12 题
[GESP202609 四级 C++] 第 12 题
下面代码的时间复杂度是( )。
int countPairs(int a[], int n) {
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (a[i] + a[j] == 100) {
cnt++;
}
}
}
return cnt;
}
{{ select(1) }}