数学!!!简单 大大降低时间复杂度 摘要:解题思路:普通暴力嵌套两个循环可以算出来 但是时间超限 那就不得不改变算法了。给定一组数 a1,a2,…,an,我们要求的是它们两两相乘的和,即:S=a1a2+a1a3+⋯+an−1an为了简化计算,…… 题解列表 2024年04月10日 0 点赞 0 评论 404 浏览 评分:8.0
点和正方形的关系 摘要:# include <bits/stdc++.h> using namespace std; int main () { int x,y; cin >> x >> y; …… 题解列表 2024年04月10日 1 点赞 0 评论 260 浏览 评分:10.0
计算邮资(C++) 摘要:# include <bits/stdc++.h> using namespace std; int main () { int n; char c; cin >> n >…… 题解列表 2024年04月10日 0 点赞 0 评论 338 浏览 评分:9.9
2124: 信息学奥赛一本通T1259-求最长不下降序列(DP)指定输出顺序 摘要:解题思路:DP, 以i节点为结束的最长不下降序列 f[i] = max(f[i], f[j] + 1) j > 1 && j < i;注意事项:输出顺序小数优先:判断相等最长情况下, 采用小数优先 …… 题解列表 2024年04月10日 0 点赞 0 评论 249 浏览 评分:9.9
超快set解法 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ set<string>s; int n,k; …… 题解列表 2024年04月09日 0 点赞 0 评论 172 浏览 评分:0.0
编写题解 2835: 计算书费 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ float q,w,e,r,t,y,u,i,o,p; ci…… 题解列表 2024年04月09日 1 点赞 0 评论 219 浏览 评分:10.0
蓝桥杯2020年第十一届省赛真题-整数拼接 c++优化枚举 摘要:解题思路:使用暴力枚举肯定是要超时的,在枚举前先进行一次预处理 a和b拼接 可看成 a乘以10的b长度次方加上b反过来同理 可以使用一个数组f[i][j]存储乘以10的i次方余数为j的数的数量 记得特…… 题解列表 2024年04月09日 0 点赞 0 评论 395 浏览 评分:0.0
2577: 蓝桥杯2020年第十一届省赛真题-走方格(DFS) 摘要:**很明显的DFS,但是直接dfs暴力搜在其他网站上会超时,这里可以直接AC** 还需要继续优化 ###直接DFS: ```cpp #include using namespace std;…… 题解列表 2024年04月09日 1 点赞 1 评论 243 浏览 评分:10.0
两个for循环(2n-2) 摘要:解题思路:对于n棵灌木,其最边上的灌木最高可以长到2n-2,边上倒数第二棵树就相当于求n-1棵灌木的边,以此类推......一直求到中轴线(如果是奇数的话包括中轴线),并将每一次的结果对称过去,就得到…… 题解列表 2024年04月08日 4 点赞 0 评论 482 浏览 评分:0.0
2228: 蓝桥杯算法训练-Anagrams问题 摘要: #include #include using namespace std; int main() { char a[80],b[80…… 题解列表 2024年04月08日 0 点赞 0 评论 311 浏览 评分:0.0