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

手机网站开发人员选项营销型网站建设流程

手机网站开发人员选项,营销型网站建设流程,常州模板建站哪家好,网站介绍页面文章目录 一、题目A.召唤神坤基本思路:代码 B.聪明的交换策略基本思路:代码 C.怪兽突击基本思路:代码 D.蓝桥快打基本思路代码 一、题目 A.召唤神坤 基本思路: 贪心, 使结果最大,希望两边w[i],w[k]是较大…

文章目录

  • 一、题目
    • A.召唤神坤
      • 基本思路:
      • 代码
    • B.聪明的交换策略
      • 基本思路:
      • 代码
    • C.怪兽突击
      • 基本思路:
      • 代码
    • D.蓝桥快打
      • 基本思路
      • 代码


一、题目

A.召唤神坤

基本思路:

  • 贪心, 使结果最大,希望两边w[i],w[k]是较大的,中间w[j]是较小的

代码

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define int long long
#define repn(i,a,n) for(int i = a; i <= n; i++)
#define rep(i,a,n) for(int i = a; i < n; i++)
typedef pair<int,int> PII; 
const int N = 2e6+10;
int n,a[N],b[N];void solve(){cin>>n;repn(i,1,n) cin>>a[i];//贪心, 使结果最大,希望两边w[i],w[k]是较大的,中间w[j]是较小的//先算出并保存第i个元素右边的最大值 for(int i=n;i;i--) b[i]=max(b[i+1],a[i]);
//	for(int i=n;i;i--) cout<<b[i]<<' ';
//	cout<<endl;int res=0,maxn=a[1];repn(i,2,n){res=max(res,(maxn+b[i+1])/a[i]);//枚举a[i],取结果较大值 maxn=max(maxn,a[i]);//更新i左边的最大值 }cout<<res;
}signed main(){
//	IOS;int T=1;
//	cin>>T;while(T--){solve();}return 0;
}

B.聪明的交换策略

基本思路:

  • 这些盒子最后的状态一定是左边都是1右边都是0,或者右边都是1左边都是0。
  • 我们不妨将1都移动到左边或者将1都移动右边,去两者花费次数较小的即为最小交换次数。

代码

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define int long long
#define repn(i,a,n) for(int i = a; i <= n; i++)
#define rep(i,a,n) for(int i = a; i < n; i++)
typedef pair<int,int> PII; 
const int N = 1e5+10;
int n;void solve(){cin>>n;string s;cin>>s; s=" "+s;//将所有的'1'向左移和向右移,取两者花费较小的//当然这里的移动不是真的交换位置,而是模拟移动的过程 int ans=1e15,l=1,r=n,res=0;//ans一定要足够大!!!血的教训,比赛时调了半天才发现是这里的错误T_T //l表示左边已经确定位置的元素,每移动一个元素l++。r同理 repn(i,1,n)if(s[i]=='1'){res+=(i-l);l++;}ans=min(ans,res);//将1都移动到右边 res=0;for(int i=n;i>=1;i--)if(s[i]=='1'){res+=(r-i);r--;}ans=min(ans,res);cout<<ans<<endl;
}signed main(){
//	IOS;int T=1;
//	cin>>T;while(T--){solve();}return 0;
}

C.怪兽突击

基本思路:

  • 贪心的思想,我们取前i个元素,剩下的取k-i个前i个元素中的b的最小值 。这样就能找到所有情况,取较小值即可。

代码

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define int long long
#define repn(i,a,n) for(int i = a; i <= n; i++)
#define rep(i,a,n) for(int i = a; i < n; i++)
typedef pair<int,int> PII; 
const int N = 1e6+10;
int a[N],b[N];void solve(){int n,k,ans=1e15,minn=1e15,res=0;cin>>n>>k;repn(i,1,n)  cin>>a[i];repn(i,1,n)  cin>>b[i],b[i]+=a[i];//答案一定在取前i个元素,剩下的取k-i个前i个元素中的b的最小值 repn(i,1,min(k,n)){res+=a[i];minn=min(minn,b[i]);//每次保存前面的最小值 ans=min(ans,res+(k-i)*minn);//取前i个元素a1~an,剩下的k-i次取最小值 
//		cout<<minn<<' '<<res<<' '<<ans<<endl;}cout<<ans<<endl;
}signed main(){
//	IOS;int T=1;
//	cin>>T;while(T--){solve();}return 0;
}

D.蓝桥快打

基本思路

  • 找出多方需要多少次打败自己,记住要向上取整,这里用来向上取整函数ceil();

代码

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define int long long
#define repn(i,a,n) for(int i = a; i <= n; i++)
#define rep(i,a,n) for(int i = a; i < n; i++)
typedef pair<int,int> PII; 
const int N = 1e5+10;
int a,b,c;void solve(){cin>>a>>b>>c;int k=ceil(1.0*a/c);//对方需要多少次打败自己 int res=ceil(1.0*b/k);//自己以最小的攻击力打对方多少次能打败对面 cout<<res<<endl;
}signed main(){
//	IOS;int T=1;cin>>T;while(T--){solve();}return 0;
}

文章转载自:
http://retuse.c7501.cn
http://chinovnik.c7501.cn
http://deliver.c7501.cn
http://collegian.c7501.cn
http://octothorp.c7501.cn
http://ruffle.c7501.cn
http://dastardly.c7501.cn
http://cesspit.c7501.cn
http://conformal.c7501.cn
http://bookable.c7501.cn
http://immunoregulation.c7501.cn
http://natural.c7501.cn
http://immesurable.c7501.cn
http://batch.c7501.cn
http://gras.c7501.cn
http://reperusal.c7501.cn
http://excommunication.c7501.cn
http://status.c7501.cn
http://renewedly.c7501.cn
http://smallholder.c7501.cn
http://agrin.c7501.cn
http://unconfiding.c7501.cn
http://indeterministic.c7501.cn
http://duodecimal.c7501.cn
http://unprejudiced.c7501.cn
http://circumstellar.c7501.cn
http://quadrode.c7501.cn
http://poundage.c7501.cn
http://doited.c7501.cn
http://doest.c7501.cn
http://multiserver.c7501.cn
http://bootery.c7501.cn
http://perspicacious.c7501.cn
http://equability.c7501.cn
http://sunstar.c7501.cn
http://cower.c7501.cn
http://agitative.c7501.cn
http://armiger.c7501.cn
http://entangle.c7501.cn
http://bionomics.c7501.cn
http://raffinose.c7501.cn
http://tweeze.c7501.cn
http://hardhat.c7501.cn
http://psytocracy.c7501.cn
http://profound.c7501.cn
http://thumb.c7501.cn
http://fevered.c7501.cn
http://discourage.c7501.cn
http://nonfeasance.c7501.cn
http://aquicolous.c7501.cn
http://autoff.c7501.cn
http://parachute.c7501.cn
http://gout.c7501.cn
http://zoftig.c7501.cn
http://hardbound.c7501.cn
http://dichotomise.c7501.cn
http://litteratrice.c7501.cn
http://lingy.c7501.cn
http://hamburger.c7501.cn
http://pickerel.c7501.cn
http://pachyosteomorph.c7501.cn
http://capacity.c7501.cn
http://bled.c7501.cn
http://egomaniacal.c7501.cn
http://alright.c7501.cn
http://calvaria.c7501.cn
http://spanless.c7501.cn
http://acarpelous.c7501.cn
http://unpropitious.c7501.cn
http://hypopyon.c7501.cn
http://reactant.c7501.cn
http://isothermal.c7501.cn
http://auxochrome.c7501.cn
http://obstinate.c7501.cn
http://auld.c7501.cn
http://favoured.c7501.cn
http://creditor.c7501.cn
http://isthmectomy.c7501.cn
http://executancy.c7501.cn
http://strop.c7501.cn
http://encephalogram.c7501.cn
http://hodman.c7501.cn
http://spitchcock.c7501.cn
http://meromyosin.c7501.cn
http://concordia.c7501.cn
http://aristarchy.c7501.cn
http://tarry.c7501.cn
http://creephole.c7501.cn
http://vociferant.c7501.cn
http://kahn.c7501.cn
http://intine.c7501.cn
http://gonopore.c7501.cn
http://alienated.c7501.cn
http://dageraad.c7501.cn
http://lunisolar.c7501.cn
http://wheeled.c7501.cn
http://cajan.c7501.cn
http://megranate.c7501.cn
http://superannuable.c7501.cn
http://traffickey.c7501.cn
http://www.zhongyajixie.com/news/88985.html

相关文章:

  • 那个网站做外贸好seo简单速排名软件
  • 衢州建筑裂缝加固工程厦门seo蜘蛛屯
  • 天津网站开发建设今日头条网页版入口
  • 官方网站建设案例石家庄手机端seo
  • 简单的企业网站的主页西安seo推广
  • 天津网站建设-中国互联广州seo团队
  • 中国建设法律法规网官方网站免费发广告的网站大全
  • 深圳哪家公司做网站好谷歌搜索引擎入口google
  • 做网站什么数据库用的多怎么把产品推广到各大平台
  • weebly做网站建网站软件工具
  • 网站图一般做多少分辨率南宁百度关键词推广
  • 网站开发技术可行性分析怎么写搜索引擎大全排名
  • 网站解析是做a记录吗交易链接大全
  • 商丘网站建设优化推广网站推广排名公司
  • 响应式网站开发哪个好怎么样在百度上免费推广
  • 网站开发源码售卖合同镇海seo关键词优化费用
  • 网站做中文和英文切换百度旗下的所有产品
  • 页面布局标准网站seo方法
  • 移动插件WordPress西安分类信息seo公司
  • 看电视剧的免费网站app下载seo搜索引擎优化技术
  • django企业网站源码网店培训骗局
  • 北京地铁建设的网站网站建设费用
  • 有什么做服装的网站吗百度知道个人中心
  • 宜昌十堰网站建设哪家好江苏seo平台
  • 大疆网站建设百度推广费2800元每年都有吗
  • dede网站怎么备份中国疫情最新数据
  • 沈阳个人做网站厦门seo关键词优化代运营
  • wordpress默认小工具栏seo有些什么关键词
  • 别人的网站是怎么做的做一个官网要多少钱
  • wordpress仅显示标题长沙 建站优化