题解列表

筛选

2901: 查找特定的值

摘要:参考代码:#include <bits/stdc++.h>using namespace std;int a,b,d;int c[1000000];int main(){    int sum=1; ……

3020: 最大数位置

摘要:参考代码:#include <bits/stdc++.h>using namespace std;int a,sum;int c[1000000];int main(){    cin >>a;   ……

题解 2821: 开关灯

摘要:解题思路:首先,如何确定每盏灯的开关?——可以用1代表初始值“开”。for(int i=1;i<=n;i++) {     light[i]=1; }接下来,如何表示每个人对灯的反向操作?for……

C语言解全排列

摘要:解题思路:注意事项:两种代码,第二种交换的代码由于最终打印顺序不同通过不了此题参考代码:#include <stdio.h>#include <string.h>#include <stdbool.h……

回文串(C++)简单易懂

摘要:参考代码:#include <iostream>#include <string>using namespace std;bool isPalindrome(string str) {    int ……

直方图(C++)简单解

摘要:参考代码:#include <iostream>#include <vector>#include <algorithm>using namespace std;int main() {    int……
优质题解

蓝桥杯基础练习VIP-阶乘计算(C++自定义函数解题)

代码解析:multiply函数实现高精度乘法。它接受一个存储数字的向量num和一个因子factor作为参数,并返回乘法结果的向量result。在multiply函数中,使用carry变量来保存进位。在for循环中,逐位进行乘法运算,并将结果加入result向量中。