![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
整理part
孤枪
静
展开
-
TKO 2-5 贪心算法之稳定排序2 基本素质2093
Problem DescriptionC++编程考试使用的实时提交系统,具有即时获得成绩排名的特点。它的功能是怎么实现的呢?我们做好了题目的解答,提交之后,要么“AC”,要么错误,不管怎样错法,总是给你记上一笔,表明你曾经有过一次错误提交,因而当你一旦提交该题“AC”后,就要与你算一算帐了,总共该题错误提交了几回。虽然你在题数上,大步地跃上了一个台阶,但是在耗时上要摊上你共花去的时间。特别是,曾经有过的错误提交,每次都要摊上一定的单位时间分。这样一来,你在做出的题数上,可能领先别人很多,但是,在做出同样原创 2021-04-11 15:24:48 · 123 阅读 · 0 评论 -
TKO 2-4基本贪心之求最小数字 3183
问题描述琪琪喜欢旅行。有一天她找到了一盏魔法灯,可惜灯里的精灵没那么亲切。琪琪必须回答一个问题,然后精灵就会实现她的梦想之一。问题是:给你一个整数,你可以删除确切的m位。左数字将形成一个新的整数。你应该把它最小。不允许更改数字的顺序。现在你能帮助琪琪实现她的梦想吗?输入有几个测试案例。每个测试案例将包含您给出的整数(最多可能包含 1000 位数字)和整数 m(如果整数包含 n 位,m 不会比 n 大)。给定整数将不包含领先零。输出对于每个案例,输出可以在一行中获取的最低结果。如果结果包含领原创 2021-04-11 15:20:33 · 132 阅读 · 0 评论 -
TKO 2-3贪心问题之妙不可言的搬桌子问题
Problem DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.The floor has 200 rooms each on the north side and south side along the corridor. Recently the Company made a plan原创 2021-05-09 13:28:26 · 109 阅读 · 0 评论 -
TKO 2-2需要考虑周全的贪心问题--田忌赛马
Problem DescriptionHere is a famous story in Chinese history.“That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.”“Both of Tian and the king have three horses in d原创 2021-05-09 13:22:42 · 97 阅读 · 0 评论 -
TKO 2-1基本贪心问题之 硕鼠的交易
贪心老鼠的交易Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room contains J[i] pounds of JavaBeans and requires F[i] pou原创 2021-05-09 13:18:57 · 530 阅读 · 0 评论 -
TKO 1-3基本三分思维
#include<stdio.h>#include<math.h>double fx(double x,double y){return 6pow(x,7.0)+8pow(x,6.0)+7pow(x,3.0)+5pow(x,2.0)-y*x;}double bottom,top,mid;int main(){double y;int T;double liftthird,rightthird; scanf("%d",&T);while(T--)原创 2021-05-09 11:30:35 · 94 阅读 · 0 评论 -
TKO 1-2基本快速幂的基本操作(熟背)
以余数为例:#includeusing namespace std;int power(int a,int b,int p){int ans=1%p;for(;b;b>>=1){if(b&1)ans=(long long)ansa%p;a=(long long)aa%p;}return ans;}int main(){int a,b,p;while(cin>>a&&a!=0){cout<<“请输入指数:”<&l原创 2021-05-09 11:25:14 · 97 阅读 · 0 评论 -
TKO 1-1辗转相除法计算最大公倍数和最小公倍数
需要谨记的基本算法:辗转相除法求 最大公倍数和最小公倍数!!!#include<stdio.h>int main(){int a,b,c,d,t,bei;while(scanf("%d %d",&a,&b)==2){c=a;d=b;while(b){ t=a%b; a=b; b=t;}bei=c*d/a;printf("%d\n",bei);}return 0;}...原创 2021-05-09 10:57:33 · 65 阅读 · 0 评论 -
学习感悟
有些自己会的东西就不必写在CSDN上面了,因为费时费力,成效还没有去学习自己没有涉及的领域好,所以从今天开始,但当涉猎把!原创 2021-05-09 10:55:30 · 48 阅读 · 0 评论