EXY-SC-1255
第 246 题
2025 是个神奇的数字,因为它是由两个数 20 和 25 拼接而成,而且 $2025 = (20 + 25)^2$。小杨决定写个程序找找小于 $N$ 的正整数中共有多少这样神奇的数字。该函数的时间复杂度为( )。
#include <string>
int count_miracle(int N) {
int cnt = 0;
for (int n = 1; n * n < N; n++) {
int n2 = n * n;
std::string s = std::to_string(n2);
for (int i = 1; i < s.length(); i++)
if (s[i] != '0') {
std::string s1 = s.substr(0, i);
std::string sr = s.substr(i);
int n1 = std::stoi(s1);
int nr = std::stoi(sr);
if (__________) // 在此处填入选项
cnt++;
}
}
return cnt;
}
语言:
C++
GESP真题
八级
2025.3
单选题号:
10
EXY-SC-1254
第 247 题
2025 是个神奇的数字,因为它是由两个数 20 和 25 拼接而成,而且 $2025 = (20 + 25)^2$。小杨决定写个程序找找小于 $N$ 的正整数中共有多少这样神奇的数字。下面程序横线处应填入的是( )。
#include <string>
int count_miracle(int N) {
int cnt = 0;
for (int n = 1; n * n < N; n++) {
int n2 = n * n;
std::string s = std::to_string(n2);
for (int i = 1; i < s.length(); i++)
if (s[i] != '0') {
std::string s1 = s.substr(0, i);
std::string sr = s.substr(i);
int n1 = std::stoi(s1);
int nr = std::stoi(sr);
if (__________) // 在此处填入选项
cnt++;
}
}
return cnt;
}
语言:
C++
GESP真题
八级
2025.3
单选题号:
9
EXY-SC-1253
第 248 题
下列关于算法的说法,错误的是( )。
语言:
C++
GESP真题
八级
2025.3
单选题号:
8
EXY-SC-1252
第 249 题
$N$ 个节点的平衡二叉树的高为( )。
语言:
C++
GESP真题
八级
2025.3
单选题号:
7
EXY-SC-1251
第 250 题
已定义 double 类型的变量 r 和 theta,分别表示图中圆半径和圆心角。下列表达式中可以求出弦长 s 的是( )。

语言:
C++
GESP真题
八级
2025.3
单选题号:
6
当前页显示 246 - 250
,共 1260 道单选题