题解列表

筛选

蓝桥杯算法训练VIP-暗恋

摘要:解题思路:维护一个二维数组的前缀和数组,随后对其检测每一个正方形,若全为1则该正方形的和为其面积。若全为0,则正方形的和为0参考代码:#include<bits/stdc++.h> using na……

1179: 上车人数(有点意思)

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int a[100],b[100],c[100];//数组a上车……

1175: 金明的预算方案

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int n,m; cin>>n>>m;    int sum=1……

LETTERS(经典DFS)

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cstdio> using namespace std; int r, s,t1=0,t2;//r,s表示迷……

简单的递归

摘要:解题思路:注意事项:注意递归的出口 和递推公式的条件参考代码:#include<cstdio>#include<iostream>#include<cstring>#include<cmath>usi……

c++ 找规律分奇数偶数

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int main() { int a[10000],n; ci……

易理解的计算与求和

摘要:解题思路:注意事项:累计高度加到n-1;为了便于计算全部2*之后-初始高度*1;注意幂次表达用cmath的pow表示参考代码:#include<cstdio>#include<iostream>#in……

汉诺塔-递归问题

摘要: #include #include using namespace std; stack s[3]; void move(int x,int y){ ……

 编写题解 3034: 自然数的拆分(DFS)

摘要:解题思路:1,首先,定义了一个名为dfs的函数,该函数接受一个参数u,表示当前节点的值。2,在dfs函数内部,首先判断u是否等于0且路径长度大于1。如果满足条件,说明已经找到了一条满足条件的路径,将路……

1170: 能量项链(绝对的好东西)

摘要:解题思路:循环复制2倍,然后先以1为头,取n个数量的为一块,然后以2为头,取n个数量为一块.....不断循环直至一个周期,最后求出最大的。注意事项:参考代码:#include<iostream>usi……