素数判断小小加强写法 摘要:解题思路:1、输入数字小于2直接退出2、大于2直接输出2,为了后面来判断的数字都是基数做个小铺垫,应为偶数不可能是素数嘛3、比较范围上限用根号更好节省时空注意事项:参考代码:#include<iost…… 题解列表 2022年03月13日 0 点赞 0 评论 357 浏览 评分:0.0
快速排序!!! 摘要:```cpp #include using namespace std; const int L = 100000 + 2; int q[L]; int n; void quick_s…… 题解列表 2022年03月13日 0 点赞 0 评论 381 浏览 评分:0.0
快速排序!!!!! 摘要:```cpp #include using namespace std; const int L = 10 + 2; int q[L]; int len; void quick_sort(…… 题解列表 2022年03月13日 0 点赞 0 评论 370 浏览 评分:8.0
优质题解 1102: 明明的随机数 摘要:解题思路:去重:数组的去重是很难直接把重复值“删去”的,此题要求输入的随机数都是正整数,所以可以把重复值全改成0,最后输出非0数,就算去重了。先排序,后去重。排序使用快速排序。注意事项:快速排序函数中…… 题解列表 2022年03月13日 1 点赞 0 评论 1279 浏览 评分:10.0
编写题解 1049: [编程入门]结构体之时间设计 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;struct date{ int year; int month; int …… 题解列表 2022年03月13日 0 点赞 0 评论 347 浏览 评分:0.0
编写题解 1046: [编程入门]自定义函数之数字后移 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[20],b[20]; int n,m; …… 题解列表 2022年03月13日 0 点赞 0 评论 328 浏览 评分:0.0
优质题解 1100: 采药(背包问题) 摘要:解题思路:属于背包问题,用动态规划的思想求解。核心计算公式:t时间内考虑m个草药并且选择“采”的价值,计算公式为:(t - 第m个草药的耗时)时间内考虑(m - 1)个草药的最有解 + 第m个草药的价…… 题解列表 2022年03月13日 0 点赞 0 评论 1643 浏览 评分:7.0
时间换算!!!! 摘要:```cpp #include using namespace std; long long n; int shi, fen, miao; int main(){ cin >> n; …… 题解列表 2022年03月13日 0 点赞 0 评论 761 浏览 评分:9.9
1099: 校门外的树 摘要:解题思路:暴力解法,建一个大小为n的数组存储树的状态。时间复杂度是O(n),题解里面那个扫描线差分我还没看懂。注意事项:太暴力太丑陋了。参考代码:// 题目 1099: 校门外的树 #include…… 题解列表 2022年03月13日 0 点赞 1 评论 280 浏览 评分:9.9
蓝桥杯基础练习VIP-回形取数 dfs 摘要:解题思路: K控制方向注意事项:参考代码:#include <bits/stdc++.h> using namespace std; int arr[201][201]; int vis[20…… 题解列表 2022年03月13日 0 点赞 0 评论 296 浏览 评分:0.0