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

用虚拟机做网站的心得体会怎么做好销售

用虚拟机做网站的心得体会,怎么做好销售,昆明专业网站建设,宁波做外贸网站文章目录 前言Ⅰ. 数的范围0x00 算法思路0x00 代码书写 Ⅱ. 数的三次方根0x00 算法思路0x01代码书写 Ⅲ. 前缀和0x00 算法思路0x01 代码书写 Ⅳ. 子矩阵的和0x00 算法思路0x01 代码书写 Ⅴ. 机器人跳跃问题0x00 算法思路0x01 代码书写 Ⅵ. 四平方和0x00 算法思路0x01 代码书写 …

文章目录

  • 前言
  • Ⅰ. 数的范围
    • 0x00 算法思路
    • 0x00 代码书写
  • Ⅱ. 数的三次方根
    • 0x00 算法思路
    • 0x01代码书写
  • Ⅲ. 前缀和
    • 0x00 算法思路
    • 0x01 代码书写
  • Ⅳ. 子矩阵的和
    • 0x00 算法思路
    • 0x01 代码书写
  • Ⅴ. 机器人跳跃问题
    • 0x00 算法思路
    • 0x01 代码书写
  • Ⅵ. 四平方和
    • 0x00 算法思路
    • 0x01 代码书写
  • Ⅶ. 分巧克力
    • 0x00 算法思路
    • 0x01 代码书写
  • Ⅷ. 激光炸弹
    • 0x00 算法思路
    • 0x01 代码书写
  • Ⅸ. K倍区间
    • 0x00 算法思路
    • 0x01 代码书写
  • 总结


前言

本篇博客主要打卡记录博主学习蓝桥杯C++AB组辅导课的习题第一章节的题目。


Ⅰ. 数的范围

0x00 算法思路

详细可以看下这一篇博客,详细讲解了二分算法知识
【algorithm】算法基础课—二分查找算法(附笔记 | 建议收藏)

0x00 代码书写

#include <iostream>using namespace std;const int maxn = 100005;
int n, q, x, a[maxn];int main() 
{scanf("%d%d", &n, &q);for (int i = 0; i < n; i++) scanf("%d", &a[i]);while (q--) {scanf("%d", &x);int l = 0, r = n - 1;while (l < r) {int mid = l + r >> 1;if (a[mid] < x)  l = mid + 1;else    r = mid;}if (a[l] != x) {printf("-1 -1\n");continue;}int l1 = l, r1 = n;while (l1 + 1 < r1) {int mid = l1 + r1 >> 1;if (a[mid] <= x)  l1 = mid;else    r1 = mid;}printf("%d %d\n", l, l1);}return 0;
}

Ⅱ. 数的三次方根

0x00 算法思路

1.迭代的思路,就是无脑迭代100次就可.
2.根据题目法写的方法,其实这个就是while(r-l>谁就行啦).

0x01代码书写

#include<iostream>
#include<cstdio>using namespace std;int main()
{double n;scanf("%lf",&n);double l = -100000, r = 100000;while(r - l > 0.00000001){double mid = (l + r) / 2;if(mid * mid * mid >= n) r = mid;else l = mid;}printf("%.6lf",l);return 0;
}

Ⅲ. 前缀和

0x00 算法思路

详细知识看算法基础课笔记 前缀和与差分
【algorithm】认真讲解前缀和与差分 (图文搭配)

0x01 代码书写

#include<iostream>using namespace std;int n,m;
int sum[100010];int main()
{cin>>n>>m;for(int i=1;i<=n;i++){int tmp;cin>>tmp;sum[i]=sum[i-1]+tmp;}while(m--){int l,r;cin>>l>>r;cout<<sum[r]-sum[l-1]<<endl;}return 0;
}

Ⅳ. 子矩阵的和

0x00 算法思路

详细知识看算法基础课笔记 前缀和与差分
【algorithm】认真讲解前缀和与差分 (图文搭配)

0x01 代码书写

#include<iostream>using namespace std;int n,m,q;
int s[1010][1010];int main()
{cin>>n>>m>>q;for(int i=1;i<=n;i++)for(int j=1;j<=m;j++){cin>>s[i][j];}for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){s[i][j]+=s[i-1][j]+s[i][j-1]-s[i-1][j-1];}}while(q--){int x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;cout<<s[x2][y2]-s[x1-1][y2]-s[x2][y1-1]+s[x1-1][y1-1]<<endl;}return 0;
}

Ⅴ. 机器人跳跃问题

0x00 算法思路

这一道题主要考查了二分答案的算法,通过物理计算得到不论是从低到高,还是从高到低都是:e = 2 * e - h[i] 所以我们假设有一个临界点 E0 满足 0 ~ E0 能量是不满足的,E0 ~ 0x3f3f3f3f 是满足的,就可以使用y总的二分模板了。

0x01 代码书写

#include<bits/stdc++.h>using namespace std;const int N = 100010;int n;
int h[N];bool check(int e)
{for(int i = 1 ; i <= n ; ++ i){e = e * 2 - h[i];if(e >= 1e5) return true;//防止爆intelse if(e < 0) return false;    }return true;
}int main()
{cin >> n;for(int i = 1 ; i <= n ; ++ i) cin >> h[i];int l = 0 , r = 1e5;while(l < r){int mid = l + r >> 1;if(check(mid)) r = mid;else l = mid + 1;}cout << r << endl;return 0;
}

Ⅵ. 四平方和

0x00 算法思路

这一道题我没学具体的算法思路,感觉不如暴力来的实在,确信哈哈哈

0x01 代码书写

#include<iostream>
#include<cmath>using namespace std;int n;
int a,b,c,d;int main()
{scanf("%d",&n);for(int a=0;a*a<=n;a++){for(int b=a;a*a+b*b<=n;b++){for(int c=b;a*a+b*b+c*c<=n;c++){int t=n-a*a-b*b-c*c;int d=sqrt(t);if(d*d==t){printf("%d %d %d %d\n",a,b,c,d);return 0;}}}}return 0;
}

Ⅶ. 分巧克力

0x00 算法思路

这道题主要考查了二分算法,主要是对于一块大巧克力进行分割,思考的到,当分割的块数越多,边长就越短,块数越少,边长就越大,所以肯定可以有一个临界点 mid 可以使得刚好的块数 满足要求 刚好 >= k 块 如果边长 在 Left ~ mid 之间的话 就是边长很大 所以check函数可以判断这个, 如果在 mid ~ Right 之间的话 肯定是都满足要求的。 最后套用y总的算法模板即可

0x01 代码书写

#include<bits/stdc++.h>using namespace std;const int N = 100010;int n,k;
int h[N],w[N];bool check(int mid)
{int res = 0;for(int i = 0 ; i < n ; ++ i){res += (long long)h[i] / mid * (w[i] / mid);if(res >= k) return true;}return false;
}int main()
{cin >> n >> k;for(int i = 0 ; i < n ; ++ i) cin >> h[i] >> w[i];int l = 1 , r = 1e5;while(l < r){int mid = l + r + 1 >> 1;if(check(mid)) l = mid;else r = mid - 1;}cout << r << endl;return 0;
}

Ⅷ. 激光炸弹

0x00 算法思路

贴一个acwing的图片 : 链接 : AcWing 99. 激光炸弹第一题解
在这里插入图片描述
在这里插入图片描述

0x01 代码书写

#include<bits/stdc++.h>using namespace std;const int N = 5010;
int cnt,r;
int s[N][N];
int n,m;int main()
{cin >> cnt >> r;r=min(r,5001);n = m = r;while(cnt --){int x,y,w;cin >> x >> y >> w;x ++;y ++;n = max(x,n);m = max(y,m);s[x][y] += w;}for(int i = 1; i <= n; ++ i)for(int j = 1; j <= m ;++ j)// 构造二维前缀和s[i][j] += s[i-1][j] + s[i][j-1] - s[i-1][j-1];int res = 0;      for(int i = r; i <= n ;++ i){for(int j = r; j <= m ;++ j)//根据二维前缀和进行答案计算{res = max(res, s[i][j]-s[i-r][j]-s[i][j-r]+s[i-r][j-r]);}}cout << res << '\n';return 0;
}

Ⅸ. K倍区间

0x00 算法思路

这一道题我只是用了 前缀和做优化,感觉我考试的时候也想不到y总的算法思路,呜呜呜呜呜…

0x01 代码书写

#include<iostream>using namespace std;int n,k;
int a[100010];
int sum[100010];int main()
{cin>>n>>k;for(int i=1;i<=n;i++) cin>>a[i];int ans=0,i=0;for(i=1;i<=n;i++){sum[i]=sum[i-1]+a[i];}for(int j=1;j<=i;j++){for(int s=j+1;s<=i;s++){if((sum[s]-sum[j])%k==0) // 前缀和优化{ans++;}else continue;}}cout<<ans;return 0;
}

总结

本篇博客主要讲解了前缀和 和 二分算法的知识,前面四道题都是算法基础课 的模板题,后面几道题才是真正考查这两个算法的真实难度,开始我也觉得很难很难,但是认真学习完发现其实还是可以学会的,所以请热爱 请认真学习,总会学好,总会获得不小的进步的,加油吧夏目浅石.


文章转载自:
http://tracheobronchial.nLcw.cn
http://untiringly.nLcw.cn
http://indubitability.nLcw.cn
http://privatdozent.nLcw.cn
http://piecemeal.nLcw.cn
http://mosaic.nLcw.cn
http://sainted.nLcw.cn
http://mazuma.nLcw.cn
http://clipper.nLcw.cn
http://lusi.nLcw.cn
http://recover.nLcw.cn
http://newel.nLcw.cn
http://aerie.nLcw.cn
http://blessed.nLcw.cn
http://anubis.nLcw.cn
http://surfperch.nLcw.cn
http://geomedicine.nLcw.cn
http://semilegendary.nLcw.cn
http://weevil.nLcw.cn
http://wakashan.nLcw.cn
http://nimrod.nLcw.cn
http://pearmain.nLcw.cn
http://landfall.nLcw.cn
http://hubbub.nLcw.cn
http://jeeves.nLcw.cn
http://maoridom.nLcw.cn
http://intractability.nLcw.cn
http://strychnine.nLcw.cn
http://uncontroverted.nLcw.cn
http://plainchant.nLcw.cn
http://doublespeak.nLcw.cn
http://nfwi.nLcw.cn
http://meninges.nLcw.cn
http://fluorometric.nLcw.cn
http://wrongheaded.nLcw.cn
http://casuist.nLcw.cn
http://reimportation.nLcw.cn
http://implantation.nLcw.cn
http://millilitre.nLcw.cn
http://perforate.nLcw.cn
http://doulton.nLcw.cn
http://graduand.nLcw.cn
http://immix.nLcw.cn
http://unhandsomely.nLcw.cn
http://attestation.nLcw.cn
http://fleabane.nLcw.cn
http://anna.nLcw.cn
http://enslave.nLcw.cn
http://chic.nLcw.cn
http://suburb.nLcw.cn
http://exfiltration.nLcw.cn
http://weightless.nLcw.cn
http://occasional.nLcw.cn
http://brutalize.nLcw.cn
http://thing.nLcw.cn
http://casuistry.nLcw.cn
http://cayuse.nLcw.cn
http://leathercoat.nLcw.cn
http://joad.nLcw.cn
http://dovishness.nLcw.cn
http://diametral.nLcw.cn
http://semisacred.nLcw.cn
http://unyielding.nLcw.cn
http://horner.nLcw.cn
http://portland.nLcw.cn
http://spicknel.nLcw.cn
http://flyblown.nLcw.cn
http://athwartship.nLcw.cn
http://cigaret.nLcw.cn
http://ponderosity.nLcw.cn
http://thuggish.nLcw.cn
http://cerebral.nLcw.cn
http://velveteen.nLcw.cn
http://annoying.nLcw.cn
http://prolan.nLcw.cn
http://echinococcus.nLcw.cn
http://preadolescent.nLcw.cn
http://baseboard.nLcw.cn
http://safedeposit.nLcw.cn
http://diglot.nLcw.cn
http://piaster.nLcw.cn
http://shading.nLcw.cn
http://amidate.nLcw.cn
http://hemocoele.nLcw.cn
http://dhol.nLcw.cn
http://vitebsk.nLcw.cn
http://ohg.nLcw.cn
http://pathogenesis.nLcw.cn
http://chrismatory.nLcw.cn
http://ungracefully.nLcw.cn
http://tubifex.nLcw.cn
http://spiculate.nLcw.cn
http://housework.nLcw.cn
http://trunkless.nLcw.cn
http://disposedly.nLcw.cn
http://underbought.nLcw.cn
http://unnotched.nLcw.cn
http://portcullis.nLcw.cn
http://peppermint.nLcw.cn
http://coatee.nLcw.cn
http://www.15wanjia.com/news/66392.html

相关文章:

  • 开发区网站建设软文营销的成功案例
  • 海口网站建设服务宁波网站推广运营公司
  • 如何快速建设自适应网站什么是关键词
  • 哪里有手机网站制作公司steam交易链接在哪看
  • 哈尔滨铁路局建设网站搜狗关键词排名查询
  • 信阳做网站的网站的宣传推广方式
  • 虹口门户网站建设百度问一问免费咨询
  • 网站设计 收费销售怎么找客户源
  • 文献综述 php网站开发千万别在百度上搜别人名字
  • 网站建设论文结束语东莞网络排名优化
  • php网站开发零基础教程seo课程培训学校
  • 网站推广是网站建设完成之后的长期工作百度一下首页百度
  • 淘宝网站建设可靠百度快照收录
  • 企业系统建设山东自助seo建站
  • 做网站的功能结构布局百度博客收录提交入口
  • 浦江网站建设推广什么app佣金高
  • 怎么做网站zwnet免费推广网站有哪些
  • 免费做国际网站上海seo培训
  • app下载软件免费下载seo三人行论坛
  • 哪里可以找到免费的java源码seochan是什么意思
  • 一台网站服务器多少钱抖音seo排名系统哪个好用
  • 做的网站被注销百度如何精准搜索
  • 单位门户网站怎么做seo宣传
  • wordpress w按钮搜索引擎优化实训心得
  • dw做的上传网站打不开苹果cms播放器
  • 给公司做门户网站seo包年优化平台
  • 珠海网站公司哪家好找谁做百度关键词排名
  • 域名解析怎么弄seo培训学什么
  • 做电商网站前端用什么框架媒体:北京不再公布疫情数据
  • 做电子商务网站最新域名解析