信息学奥赛一本通T1423-种树 解题思路:代码的思路是首先按照结束位置end对s数组进行从小到大的排序,然后遍历s数组中的每个元素。对于每个元素,首先计算数组a中在结束位置end到开始位置start之间已经被覆盖的位置数sum。如果sum大于等于需要被覆盖的次数t,则跳过该元素,继续遍历下一个元素。 题解列表 2024年03月21日 1 点赞 0 评论 1168 浏览 评分:9.9
C++速度求解,够取巧 摘要:解题思路:暴力!按题目求解注意事项: 注意有局限性,万一人家输入的数组是乱序排放呢参考代码:#include <bits/stdc++.h>using namespace std;#define N …… 题解列表 2024年03月21日 0 点赞 0 评论 538 浏览 评分:0.0
蓝桥杯2023年第十四届省赛真题-冶炼金属(C++)短代码 摘要:**短代码,先找范围再计算,数据量不大可以直接设置最大值** ```cpp #include using namespace std; //1 ≤ N ≤ 1e4,1 ≤ B ≤ A ≤ 1e…… 题解列表 2024年03月21日 0 点赞 0 评论 683 浏览 评分:0.0
2119: 信息学奥赛一本通T1184-明明的随机数 #include#include#includeusingnamespacestd;inta[105];intmain(){//使用集合去重intn,cnt=0;sets;cin>>n;for(inti=0;i>a[i];}sort(a,a+n);for(inti=0;i 题解列表 2024年03月21日 0 点赞 0 评论 756 浏览 评分:0.0
蓝桥杯【3150】一种做法~ ##3150的一种解法**第一次写题解,不好勿喷**###直接上代码```c++#includeusingnamespacestd;intfind_min(intl,intr)//找到除数的下界{inttemp=l/r;//存储直接的得出的除数, 题解列表 2024年03月21日 0 点赞 0 评论 587 浏览 评分:9.9
动态规划求最长下降子序列和最长上升子序列 摘要:#include <bits/stdc++.h> using namespace std; const int N = 30000 + 10; int a[N], f1[N], f2[N…… 题解列表 2024年03月21日 1 点赞 0 评论 594 浏览 评分:9.9
矩阵最大值c++ ```cpp#includeusingnamespacestd;intmain(){intm,n;inta[101][101];while(cin>>n>>m){for(inti=0;i>a[i][j];for(inti=0;i 题解列表 2024年03月20日 0 点赞 0 评论 1000 浏览 评分:9.9 动态规划(C++)代码 摘要:#include <iostream> using namespace std; const int N = 1000010, INF = 0x3f3f3f3f; int a[N],…… 题解列表 2024年03月20日 0 点赞 0 评论 496 浏览 评分:0.0 二维数组线性dp(C++) 摘要:#include using namespace std; const int N = 110; int f[N][N]; int a[N][N]; int main() { int …… 题解列表 2024年03月20日 0 点赞 0 评论 488 浏览 评分:9.9 蓝桥杯2023年第十四届省赛真题-整数删除 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<queue>#include<vector>using namespace std;using ll = long …… 题解列表 2024年03月20日 2 点赞 0 评论 1646 浏览 评分:9.9 « 12...238239240241242243244...16501651 »
动态规划(C++)代码 摘要:#include <iostream> using namespace std; const int N = 1000010, INF = 0x3f3f3f3f; int a[N],…… 题解列表 2024年03月20日 0 点赞 0 评论 496 浏览 评分:0.0
二维数组线性dp(C++) 摘要:#include using namespace std; const int N = 110; int f[N][N]; int a[N][N]; int main() { int …… 题解列表 2024年03月20日 0 点赞 0 评论 488 浏览 评分:9.9
蓝桥杯2023年第十四届省赛真题-整数删除 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<queue>#include<vector>using namespace std;using ll = long …… 题解列表 2024年03月20日 2 点赞 0 评论 1646 浏览 评分:9.9