自己的简单小思路,先找到那个值应该的位置,把循环分为两部分 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int main(){ int a[9]; …… 题解列表 2024年05月20日 0 点赞 0 评论 145 浏览 评分:0.0
1046 数字后移(构造新数组存储) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int n; scanf("%d",&n); int a[n]; for(i…… 题解列表 2024年05月20日 0 点赞 0 评论 193 浏览 评分:0.0
机房,LCA+dp 摘要:解题思路:先求lca,在建树的过程中dp成型,最后算,我用的重链剖分求LCA注意事项:参考代码:#include<bits/stdc++.h>#define int long long#define …… 题解列表 2024年05月21日 1 点赞 0 评论 288 浏览 评分:0.0
编写题解 1147: C语言训练-角谷猜想 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h> using namespace std;int main(){int a; cin>>a;while(a!=1){ if(…… 题解列表 2024年05月21日 0 点赞 0 评论 189 浏览 评分:0.0
用调用递归的方法写有规律的数列求和 摘要:解题思路:分数序列: 2/1 3/2 5/3 8/5 13/8 21/13...... 分子分母有规律的,分母:2、3、5、8、13、21...(n-1+n-2);分子:1、2、3、5、8、13...…… 题解列表 2024年05月22日 0 点赞 0 评论 450 浏览 评分:0.0
1646: 蓝桥杯算法训练VIP-比较字符串 摘要:解题思路:库里有strcmp函数,返回的就是第一个不一样的位置成功返回0注意事项:参考代码: #include<iostream> #include<string> #include…… 题解列表 2024年05月22日 0 点赞 0 评论 170 浏览 评分:0.0
蓝桥杯2022年第十三届决赛真题-齿轮 摘要:解题思路:通过列出算式 q=a1/a2*a2/a3*a3......an-2/an-1*an-1/an发现可以约掉中间部分只剩下头尾得到q=a1/an阅读题目发现q为整数,那么可得 a1%an=0且a…… 题解列表 2024年05月22日 0 点赞 0 评论 300 浏览 评分:0.0
蓝桥杯2022年第十三届决赛真题-卡牌 摘要:注意事项:m记得开long long参考代码:#include<bits/stdc++.h> using namespace std; struct node { long long a;…… 题解列表 2024年05月22日 0 点赞 0 评论 448 浏览 评分:0.0
1047 报数问题(一维数组遍历求解) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d",&n); int a[n+2]; for(int i=1;i<=n;i++)…… 题解列表 2024年05月22日 0 点赞 0 评论 173 浏览 评分:0.0
蓝桥杯2022年第十三届决赛真题-出差 摘要:解题思路:基本上是裸的单源最短路将隔离天数加入到行程花费时间当中,也就是从城市a到城市b需要花费a城市隔离天数加上a到b道路的天数注意事项:n可以等于1从1城市出发不需要隔离参考代码:#include…… 题解列表 2024年05月22日 0 点赞 0 评论 444 浏览 评分:0.0