2152整数区间 简单贪心算法(注释很详细) 摘要: 先说改进版:在第二个for循环做了一点剪枝提升性能//贪心规则:每次都在最早出现的右端点处取一点加入集合中 /*取点之后向左扫描左端点,扫到的就判断该区间的右端点是否在该点右边 如果在的话…… 题解列表 2023年01月06日 0 点赞 0 评论 276 浏览 评分:9.9
2151活动选择 简单贪心算法(注释很详细) 摘要:注意:根据样例可知,前一个活动的结束时间可以与后一个活动的开始时间重合//贪心规则:在完成当前的活动后,礼堂选取结束时间早的活动作为下一个活动 //结束时间早,意味着等待时间与活动时间加起来短 …… 题解列表 2023年01月06日 1 点赞 0 评论 314 浏览 评分:9.9
舍罕王的失算 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<math.h>using namespace std;int main(){ unsigned long long …… 题解列表 2023年01月06日 0 点赞 0 评论 168 浏览 评分:0.0
自由落体问题 摘要:参考代码:#include<iostream>#include<iomanip>using namespace std;int main(){ int i,n; float s=100,m=100; …… 题解列表 2023年01月06日 0 点赞 0 评论 163 浏览 评分:0.0
编写题解 1016: [编程入门]水仙花数判断 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main() { int x,y,z; for(int a=100; a<1000; …… 题解列表 2023年01月06日 0 点赞 0 评论 150 浏览 评分:0.0
编写题解 1015: [编程入门]求和训练 摘要:解题思路:注意事项:cout<<std::fixed<<setprecision(2)<<xxx=====cout<<setiosflags(ios::fixed)<<setprecision(2)<…… 题解列表 2023年01月06日 0 点赞 0 评论 175 浏览 评分:0.0
编写题解 1014: [编程入门]阶乘求和 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main() { int a,m; long long sum=0; cin>>a; …… 题解列表 2023年01月06日 0 点赞 0 评论 173 浏览 评分:0.0
2150拦截导弹问题 简单贪心算法(注释很详细) 摘要://贪心规则:炮弹打过来,让当前高度最低的系统去应对 //如果应对不了,就加一个系统,最后统计系统数 #include<bits/stdc++.h> int s[1005];//系统sy…… 题解列表 2023年01月06日 0 点赞 0 评论 368 浏览 评分:9.9
2154: 信息学奥赛一本通T1326-取余运算 摘要:解题思路:原理:a*b%k=(a%k)*(b%k)%k 要就复制吧,爱就点赞吧!注意事项:参考代码:#include<bits/stdc++.h> using namespace std; in…… 题解列表 2023年01月06日 2 点赞 0 评论 511 浏览 评分:9.9
立方和不等式 摘要:解题思路:用for循环遍历注意事项:当s==n时,输出的是最大的i;当s>n时,输出i-1;参考代码:#include<iostream>using namespace std;int main(){…… 题解列表 2023年01月05日 0 点赞 0 评论 446 浏览 评分:0.0