EXY-SC-1080
第 421 题
下面程序的输出为( )。
#include <iostream>
using namespace std;
int main() {
int cnt = 0;
for (int x = 0; x <= 10; x++)
for (int y = 0; y <= 10; y++)
for (int z = 0; z <= 10; z++)
if (x + y + z <= 15)
cnt++;
cout << cnt << endl;
return 0;
}
语言:
C++
GESP真题
八级
2024.6
单选题号:
15
EXY-SC-1079
第 422 题
下面程序的最差时间复杂度为( )。
int gcd(int m, int n) {
if (m == 0)
return n;
return gcd(n % m, m);
}
语言:
C++
GESP真题
八级
2024.6
单选题号:
14
EXY-SC-1078
第 423 题
下面程序的时间复杂度为( )。
bool notPrime[N] = {false};
void sieve() {
for (int n = 2; n * n < N; n++)
if (!notPrime[n])
for (int i = n * n; i < N; i += n)
notPrime[i] = true;
}
语言:
C++
GESP真题
八级
2024.6
单选题号:
13
EXY-SC-1077
第 424 题
二项展开式 $(x + y)^n = x^n + n x^{n-1} y + \frac{n(n-1)}{2} x^{n-2} y^2 + \ldots + y^n$ 的系数,正好满足杨辉三角的规律。当 $n = 10$ 时,二项式展开式中 $x y^9$ 项的系数是( )。
语言:
C++
GESP真题
八级
2024.6
单选题号:
12
EXY-SC-1076
第 425 题
已知一棵二叉树有 $10$ 个节点,则其中至多有( )个节点有 $2$ 个子节点。
语言:
C++
GESP真题
八级
2024.6
单选题号:
11
当前页显示 421 - 425
,共 1260 道单选题