当前位置: 首页 > news >正文

怎样做阿里巴巴网站北京搜索引擎优化管理专员

怎样做阿里巴巴网站,北京搜索引擎优化管理专员,俄罗斯局势最新消息,健身房网站模板题目来源:https://codeforces.com/gym/105161 文章目录 F - Download Speed Monitor题意思路编程 G - Download Time Monitor题意思路编程 K - Number Deletion Game题意思路编程 I - Integer Reaction题意思路编程 写在前面:今天打的训练赛打的很水&…

题目来源:https://codeforces.com/gym/105161

文章目录

  • F - Download Speed Monitor
    • 题意
    • 思路
    • 编程
  • G - Download Time Monitor
    • 题意
    • 思路
    • 编程
  • K - Number Deletion Game
    • 题意
    • 思路
    • 编程
  • I - Integer Reaction
    • 题意
    • 思路
    • 编程

写在前面:今天打的训练赛打的很水·····,我发现我们队做二分的问题做的太少了,即使看的出是二分,一样也是写不出check函数,可能是以前只做过简单的二分答案,遇到稍微难一些的二分就写不出来了,赛后得多刷刷二分答案的问题。


回归正题

F - Download Speed Monitor

题意

从第k秒开始显示下载速率,若下载速率大于等于1024,则需要进行转化。

思路

签到题,用数组模拟栈即可,后一个数进来前一个数出去。

编程

#include<bits/stdc++.h>
#define int long long 
#define endl "\n"
#define fi first
#define se second
#define PII pair<int,int> 
using namespace std;
const int N=1e5+5;
int a[N];
void solve(){int n,k;cin >> n >> k;double sum=0;for(int i=1;i<=n;++i){cin >> a[i]; if(i<=k-1){sum+=a[i];}else{sum+=a[i];if((sum/k)>=1024){printf("%.6f MiBps\n",1.0*sum/k/1024);}else printf("%.6f KiBps\n",1.0*sum/k);sum-=a[i-k+1];	}}return ;
}
signed main(){//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int t=1;//cin >> t;while(t--) solve();// cout << fixed;//强制以小数形式显示// cout << setprecision(n); //保留n位小数return 0;
}

G - Download Time Monitor

题意

给你网络宽带每秒下载速度的大小,以及两个文件的内存和开始时间,判断这两个文件需要多久才能下完(需要考虑时间重复的情况)

思路

也是一个签到题,比F题稍微复杂一点,需要考虑三种情况:

  • 两个文件下载的时间互不影响
  • 两个文件开始的时间相同
  • 两个文件下载的时间有重叠部分

考虑以上情况即可写出这道题

编程

#include<bits/stdc++.h>
#define int long long 
#define endl "\n"
#define fi first
#define se second
#define PII pair<int,int> 
using namespace std;
const int N=1e6+5;
int a[N];
void solve(){double b,t1,a1,t2,a2;scanf("%lf%lf%lf%lf%lf",&b,&t1,&a1,&t2,&a2);int t=t2-t1;//时间差if(t==0){//开始时间相同b=b/2;double ans1=0,ans2=0;if(a1>=a2){//有重叠部分ans2=a2/b;ans1=ans2;b*=2;ans1+=(a1-a2)/b;printf("%.9f ",ans1);printf("%.9f\n",ans2);return ;}else{ans1=a1/b;ans2+=ans1;b*=2;ans2+=(a2-a1)/b;printf("%.9f ",ans1);printf("%.9f\n",ans2);return ;}}else{if(a1/b<=t)//时间互不影响{printf("%.9f ",a1/b);printf("%.9f\n",a2/b);return ;}else{//有重叠部分double ans1=0,ans2=0;a1-=t*b;ans1+=t;b/=2;if(a1>=a2){ans2+=a2/b;ans1+=a2/b;b*=2;ans1+=(a1-a2)/b;printf("%.9f ",ans1);printf("%.9f\n",ans2);return ;}else{ans1+=a1/b;ans2+=a1/b;b*=2;ans2+=(a2-a1)/b;printf("%.9f ",ans1);printf("%.9f\n",ans2);return ;}}	}return ;
}
signed main(){//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int t=1;scanf("%d",&t);while(t--) solve();// cout << fixed;//Ç¿ÖÆÒÔСÊýÐÎʽÏÔʾ// cout << setprecision(n); //±£ÁônλСÊýreturn 0;
}

K - Number Deletion Game

题意

两个人进行博弈操作,每个人可以删去一个最大的数x,然后选择任意小于x的数字y,新增1,2,···y各一个,特别的当y=0,不加任何数字,谁删去最后一个数谁就获胜

思路

找规律,通过枚举可以发现:当最大的数字为奇数时,Alice必赢,反之为偶数时,Alice必输。因为最大的数字可以影响比它小的所有数,只要保证Alice开始时有着奇数个最大的数,那么他执行一步后可以将次最大的数变为偶数,只要有人执行的最大的数为偶数时,他必输,你们可以自己举例试试,本文不举例子,所以只要判断最大数的奇偶性即可。

编程

#include<bits/stdc++.h>
#define int long long 
#define endl "\n"
#define fi first
#define se second
#define PII pair<int,int> 
using namespace std;
const int N=1e3+5;
void solve(){int n;cin >> n;int sum=0;int cnt=0;for(int i=1;i<=n;++i){int x;cin >> x;if(x==cnt) sum++;else if(x>cnt){sum=1;cnt=x;}}if(sum%2) cout << "Alice" << endl;else  cout << "Bob" << endl;return ;
}
signed main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int t=1;//cin >> t;while(t--) solve();// cout << fixed;//Ç¿ÖÆÒÔСÊýÐÎʽÏÔʾ// cout << setprecision(n); //±£ÁônλСÊýreturn 0;
}

I - Integer Reaction

题意

有一串n序列的 a i a_i ai,这些整数有0和1的颜色,当序列为0的数字遇到序列为1时,必须进行消除操作(将这两个数x和y进行相加操作),然后存入一个S集合里面,若x索引不到y,则不进行消除操作,判断S集合里面最小元素的最大值是多少

思路

求最小···的最大值即可判断这题用二分,那么此题的难点在于check函数如何写,我们可以用multiset建立两个集合,一个用来存放1颜色的数字,一个用来存入0颜色的数字,由于此题单纯遍历两个集合会超时,我们可以考虑用lower_bound来二分集合里面的元素,由x+y=mid,我们可以推出y=mid-x,因此我们只需要查找另一个集合是否有大于等于mid-x的数,若有则删去该数,若没有则直接return false,循环结束说明mid满足,则return true,外边套用二分求右边界即可。

编程

#include<bits/stdc++.h>
#define int long long 
#define endl "\n"
#define fi first
#define se second
#define PII pair<int,int> 
using namespace std;
const int N=1e5+5;
int a[N],b[N];
int n;
bool check(int x){multiset<int> s1,s2;for(int i=1;i<=n;++i){if(b[i]==0){if(s1.empty()) s2.insert(a[i]);//若1集合里面为空,那么就存入0集合里else{auto t=s1.lower_bound(x-a[i]);//集合里面二分找比mid-a[i]大的数if(t==s1.end()) return false;//找不到直接returnelse s1.erase(t);//找到则删除该数}}else{if(s2.empty()) s1.insert(a[i]);else{auto t=s2.lower_bound(x-a[i]);if(t==s2.end()) return false;else s2.erase(t);}}}return true;//循环完全结束则mid满足题意
}
void solve(){cin >> n;int maxn=0;for(int i=1;i<=n;++i){cin >> a[i];maxn=max(maxn,a[i]);} for(int i=1;i<=n;++i) cin >> b[i];int l=0,r=2*maxn+1;while(l<r){//二分求右边界int mid=l+r+1>>1;if(check(mid)) l=mid;else r=mid-1;}cout << l << endl;return ;
}
signed main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int t=1;//cin >> t;while(t--) solve();// cout << fixed;//强制以小数形式显示// cout << setprecision(n); //保留n位小数return 0;
}

文章转载自:
http://chalcedonic.ddfp.cn
http://multitudinism.ddfp.cn
http://raininess.ddfp.cn
http://simile.ddfp.cn
http://foraminate.ddfp.cn
http://trigon.ddfp.cn
http://ccd.ddfp.cn
http://unfavorably.ddfp.cn
http://exedra.ddfp.cn
http://glassiness.ddfp.cn
http://ta.ddfp.cn
http://prepositor.ddfp.cn
http://adulterate.ddfp.cn
http://pyelograph.ddfp.cn
http://qualifiable.ddfp.cn
http://territorialise.ddfp.cn
http://sancta.ddfp.cn
http://stylopize.ddfp.cn
http://lachrymose.ddfp.cn
http://droughty.ddfp.cn
http://capitol.ddfp.cn
http://potash.ddfp.cn
http://triakaidekaphobe.ddfp.cn
http://postdiluvian.ddfp.cn
http://reradiative.ddfp.cn
http://leasehold.ddfp.cn
http://faience.ddfp.cn
http://muriate.ddfp.cn
http://mushily.ddfp.cn
http://labourwallah.ddfp.cn
http://autosome.ddfp.cn
http://holandric.ddfp.cn
http://glaciologist.ddfp.cn
http://astomatous.ddfp.cn
http://separateness.ddfp.cn
http://interpolate.ddfp.cn
http://himalayas.ddfp.cn
http://ratisbon.ddfp.cn
http://transcendence.ddfp.cn
http://blockship.ddfp.cn
http://ferromolybdenum.ddfp.cn
http://forane.ddfp.cn
http://jejunely.ddfp.cn
http://fruitless.ddfp.cn
http://omt.ddfp.cn
http://extrovert.ddfp.cn
http://rdo.ddfp.cn
http://stoa.ddfp.cn
http://memorandum.ddfp.cn
http://peppy.ddfp.cn
http://hundred.ddfp.cn
http://seicento.ddfp.cn
http://termly.ddfp.cn
http://otalgia.ddfp.cn
http://lactobacillus.ddfp.cn
http://pdh.ddfp.cn
http://isoparametric.ddfp.cn
http://hamiticize.ddfp.cn
http://gypsiferous.ddfp.cn
http://thingification.ddfp.cn
http://tocsin.ddfp.cn
http://filespec.ddfp.cn
http://reallocate.ddfp.cn
http://gascon.ddfp.cn
http://obstetrician.ddfp.cn
http://gerefa.ddfp.cn
http://ahl.ddfp.cn
http://bridegroom.ddfp.cn
http://foreigner.ddfp.cn
http://knocker.ddfp.cn
http://defuze.ddfp.cn
http://ascendance.ddfp.cn
http://pedagogic.ddfp.cn
http://intermedin.ddfp.cn
http://citrous.ddfp.cn
http://aiguillette.ddfp.cn
http://immateriality.ddfp.cn
http://rubber.ddfp.cn
http://horologe.ddfp.cn
http://wayfarer.ddfp.cn
http://astable.ddfp.cn
http://disclaimatory.ddfp.cn
http://everyday.ddfp.cn
http://teucrian.ddfp.cn
http://stroy.ddfp.cn
http://nobby.ddfp.cn
http://mender.ddfp.cn
http://enterable.ddfp.cn
http://inobservance.ddfp.cn
http://stronghold.ddfp.cn
http://balanoid.ddfp.cn
http://preggers.ddfp.cn
http://esthonia.ddfp.cn
http://chainlet.ddfp.cn
http://platitudinarian.ddfp.cn
http://clearweed.ddfp.cn
http://phonomotor.ddfp.cn
http://yiddish.ddfp.cn
http://diastereomer.ddfp.cn
http://partyism.ddfp.cn
http://www.hrbkazy.com/news/72392.html

相关文章:

  • 做网站英文编辑有前途石家庄seo顾问
  • 公司做网站该注意哪些杭州网络优化公司排名
  • asp网站开发人员招聘深圳seo专家
  • 珠海多语种网站制作莫停之科技windows优化大师
  • 电脑网站设计制作35个成功的市场营销策划案例
  • 小型网站用typescript成人电脑速成培训班
  • 尖叫直播上海seo推广服务
  • 怎么设计自己logo图片常用seo站长工具
  • pc网站如何做移动适配怎么让客户主动找你
  • 网络规划设计师报名银徽seo
  • 加强廉政教育网站建设广东最新消息
  • 深圳比较好的ui设计公司seo网站怎么优化
  • 曲靖网站建设seo诊断书案例
  • 做国际生意的网站有哪些百度识图入口
  • 禹州做网站百度推广网站
  • iis部署网站浏览报404国际新闻今天最新消息
  • 做网站能拿多少钱软文交易平台
  • 规划网站的总结成人专业技能培训机构
  • 网站建设公司招网站设计农大南路网络营销推广优化
  • 网站首页优化模板怎么做线上推广
  • 网站开发有限公司近一周新闻热点事件
  • 做同城网站最赚钱百度云搜索
  • 长春网站seo关键词检测
  • 优化网站制作方法大全线上培训机构有哪些
  • 张家港网站网络优化目前搜索引擎排名
  • 阿里云虚拟主机做2个网站百度推广好不好做
  • 医院网站运营方案建站cms
  • 广告拍摄制作公司郑州seo网站排名
  • 做内贸的有哪些网站足球比赛统计数据
  • 盐城网站建设多少钱培训机构查询网