#14018. [GESP202609 四级 C++] 第 23 题
[GESP202609 四级 C++] 第 23 题
下面两层循环的时间复杂度是 。
for (int i = 0; i < n; i++) {
for (int j = 1; j < n; j *= 2) {
cout << i + j;
}
}
{{ select(1) }}
- 正确
- 错误
下面两层循环的时间复杂度是 O(n2)。
for (int i = 0; i < n; i++) {
for (int j = 1; j < n; j *= 2) {
cout << i + j;
}
}
{{ select(1) }}