分数列奇偶来分别分析,易于看懂。 摘要:解题思路: 将数列分奇数列和偶数列,最大生长数其实就是2*m-2,也就是循环一次即可,而数列两边实对称的,由此可得。注意事项: 注意m在循环中的取值,切记数组底数从零开始参考代码:#include…… 题解列表 2023年12月12日 0 点赞 0 评论 192 浏览 评分:0.0
1738: 排序 C++! 摘要:解题思路:std::sort 最坏时间复杂度0(nlogn)注意事项:参考代码:#includeusing namespace std;int a[5000];int main(){ int n;…… 题解列表 2023年12月12日 0 点赞 0 评论 185 浏览 评分:0.0
编写题解 1505: 蓝桥杯算法提高VIP-单词个数统计 摘要:解题思路:注意事项:参考代码:word_list = list(input().split()) print(len(word_list))…… 题解列表 2023年12月12日 0 点赞 0 评论 150 浏览 评分:0.0
2909: 直方图 C++ 摘要:解题思路:注意事项:const int 常量(不会改变)cnt[a[i]] cnt 数量参考代码:#include<bits/stdc++.h>using namespace std…… 题解列表 2023年12月12日 0 点赞 0 评论 144 浏览 评分:0.0
2880: 计算鞍点 摘要:``` #include using namespace std; const int N=1000,M=100000; int a[N][N],dx[6],dy[6]; int main(…… 题解列表 2023年12月12日 0 点赞 0 评论 138 浏览 评分:0.0
C++代码实现 摘要:解题思路:sort排序,C++代码实现注意事项:参考代码:#include<iostream>#include<algorithm>#include<string>using namespace st…… 题解列表 2023年12月13日 0 点赞 0 评论 141 浏览 评分:0.0
纸张尺寸(python硬核解法) 摘要:解题思路:给定了初始纸张的尺寸,后面按照思路一步一步来就行,直接看注释参考代码:import math #因为题目要求向下取整,所以要导入math模块 p = list(input()) …… 题解列表 2023年12月13日 0 点赞 0 评论 210 浏览 评分:0.0
选择排序python 摘要:解题思路: 选择排序的时间复杂度是O(n^2),其中n是待排序元素的数量。这是因为选择排序的基本操作是交换和比较,而每次交换和比较都需要遍历整个数组,因此时间复杂度为O(n^2)题意直接…… 题解列表 2023年12月13日 0 点赞 0 评论 168 浏览 评分:0.0
c代码记录之剔除相关数(不用指针感觉写的好麻烦,太多循环与排序) 摘要:整体思路: 1.将每个整数的每位数字从小到大排序好,便于整数比较或字符串比较(这里用的字符串比较) 2.创建二维字符串数组str,盛放排序好的整数串 3.创建一维数组num,盛放原数,下标和串数…… 题解列表 2023年12月13日 0 点赞 0 评论 184 浏览 评分:0.0
结构体之成绩记录,中规中矩 摘要:解题思路:注意事项:注意格式的输出参考代码:#include<stdio.h>int main(){ struct LC { char a[10]; char b[10]; int c[3]; …… 题解列表 2023年12月13日 0 点赞 0 评论 408 浏览 评分:0.0