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

小额贷款 网站模板最新热点新闻

小额贷款 网站模板,最新热点新闻,做pc端网站行情,自己做网站 最好的软件//***不知道在不在进步 A 注意点&#xff1a;其实这个暴力就行&#xff0c;但有个限制&#xff0c;就是最多走100遍如果不到那就一定到不了。其实我感觉10遍就可以了&#xff0c;但WA了。不管怎么说&#xff0c;100遍不超时而且稳对。 代码&#xff1a; #include<bits/s…

//***不知道在不在进步

A

注意点:其实这个暴力就行,但有个限制,就是最多走100遍如果不到那就一定到不了。其实我感觉10遍就可以了,但WA了。不管怎么说,100遍不超时而且稳对。

代码

#include<bits/stdc++.h>
using namespace std;int t;
int n,a,b;
string s;int main()
{cin>>t;while(t--){cin>>n>>a>>b;int x=0,y=0,flag=0,g=0;cin>>s;for(int i=0;i<s.size();i++){if(g>n*100)break;if(s[i]=='N')y++;else if(s[i]=='E')x++;else if(s[i]=='S')y--;else x--;
//			cout<<x<<" "<<y<<" "<<g<<endl;if(x==a&&y==b){flag=1;break;}if(i==(s.size()-1))i=-1;g++;}if(flag==1){cout<<"YES\n";}else{cout<<"NO\n";}}return 0;
}

B

题目大意:n个数的等差数列,通过将其最大值不断取MEX,变成0 1 ... n-1的排列。

大体思路:这题其实不难想到通解,但是就是不成立的地方的特判有些细节要注意。先说通解的情况。如果b>0,那么这个排列本身就是递增的。那么只要我们每一次都变最后一位,那么一定可以将后面>n-1的全变为0~n-1范围内。接下来再考虑b=0的情况。一开始我以为只有bc都=0时才不行,但事实上b=0时c和n是有条件的。只有b==0&&n>c+2时才是不行的。

代码详解

#include<iostream>
using namespace std;
#define int long long int t;
int n,b,c;//b:d   c:初始值signed main()
{ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);cin>>t;while(t--){cin>>n>>b>>c;if(b==0&&n>c+2){cout<<-1<<endl;continue;}else if(b==0){if(c<=n-1){cout<<n-1<<endl;}else{cout<<n<<endl;}}else{if(c>n-1){cout<<n<<endl;}else{cout<<n-((n-1-c)/b)-1<<endl;}}		}return 0;
}

C

代码

#include<iostream>
using namespace std;
#define int long long int t,ans;
int n,m,v;
int a[1000010],pre[1000010],las[1000010],presum[1000010];int ef(int l,int r,int t){int mid,aa=-1;while(l<=r){mid=l+r>>1;if(las[mid]>=t){aa=mid;l=mid+1;}else{r=mid-1;}}return aa;
}signed main()
{cin>>t;while(t--){ans=0;cin>>n>>m>>v;for(int i=1;i<=n;i++){cin>>a[i];presum[i]=presum[i-1]+a[i];}int g=0;for(int i=1;i<=n;i++){g+=a[i];if(g>=v){pre[i]=pre[i-1]+1;g=0;}else{pre[i]=pre[i-1];}}g=0;for(int i=n;i>=1;i--){g+=a[i];if(g>=v){las[i]=las[i+1]+1;g=0;}else{las[i]=las[i+1];}}int flag=0;for(int i=1;i<=n;i++){int g=m-pre[i-1];int q=ef(i,n+1,g);
//			cout<<q<<endl;if(q==-1)continue;flag=1;ans=max(ans,presum[q-1]-presum[i-1]);}if(flag==0){cout<<-1<<endl;}else{cout<<ans<<endl;}}return 0;
}

题目思路:首先,Alice只能从小的一步步往大的跳。我们可以考虑一种递推思路(也有点像dp?)画个图说明:

大概就是说,从1~n递推,每一位可以从其前面比它大的数得到。其实理解这个点之后题目就迎刃而解了。当然,记录输出的话,每一位记录一下其前面一个的字母和编号即可。用个递归输出。

代码

#include<iostream>
using namespace std;
typedef pair<char,int>PII;int t,cnt;
int n;
int q[1000010],k[1000010],j[1000010];
PII ds[1000010];
pair<int,int>qm,km,jm;//qkj最大值的位置和大小;void print(int i){cnt++;if(ds[i].second==1){cout<<cnt<<endl;cout<<ds[i].first<<" "<<i<<endl;return ;}print(ds[i].second);cout<<ds[i].first<<" "<<i<<endl;
}int main()
{cin>>t;while(t--){cnt=0;cin>>n;ds[n].second=0;for(int i=1;i<=n;i++){cin>>q[i];}for(int i=1;i<=n;i++){cin>>k[i];}for(int i=1;i<=n;i++){cin>>j[i];}qm={1,q[1]};km={1,k[1]};jm={1,j[1]};for(int i=2;i<=n;i++){if(q[i]<qm.second){ds[i]={'q',qm.first};if(k[i]>km.second)km={i,k[i]};if(j[i]>jm.second)jm={i,j[i]};}else if(k[i]<km.second){ds[i]={'k',km.first};if(q[i]>qm.second)qm={i,q[i]};if(j[i]>jm.second)jm={i,j[i]};}else if(j[i]<jm.second){ds[i]={'j',jm.first};if(q[i]>qm.second)qm={i,q[i]};if(k[i]>km.second)km={i,k[i]};}}if(ds[n].second==0){cout<<"NO\n";}else{cout<<"YES\n";print(n);}}return 0;
}/*
3
1 2 3
1 3 2
1 2 3
*/

//同志仍需努力*****


文章转载自:
http://kerulen.Lbqt.cn
http://overrake.Lbqt.cn
http://stralsund.Lbqt.cn
http://electrophoretic.Lbqt.cn
http://typothetae.Lbqt.cn
http://cinematize.Lbqt.cn
http://nonaerosol.Lbqt.cn
http://unhurt.Lbqt.cn
http://succous.Lbqt.cn
http://geomorphology.Lbqt.cn
http://gain.Lbqt.cn
http://discalced.Lbqt.cn
http://gilberte.Lbqt.cn
http://sexologist.Lbqt.cn
http://forthright.Lbqt.cn
http://exserviee.Lbqt.cn
http://chalcenterous.Lbqt.cn
http://circumrotatory.Lbqt.cn
http://anthropocentric.Lbqt.cn
http://kinsmanship.Lbqt.cn
http://ungild.Lbqt.cn
http://namable.Lbqt.cn
http://landowner.Lbqt.cn
http://vigor.Lbqt.cn
http://labyrinthine.Lbqt.cn
http://zee.Lbqt.cn
http://unevaluated.Lbqt.cn
http://caledonia.Lbqt.cn
http://thymectomy.Lbqt.cn
http://presbyteral.Lbqt.cn
http://crosslet.Lbqt.cn
http://capella.Lbqt.cn
http://myoatrophy.Lbqt.cn
http://batik.Lbqt.cn
http://apodosis.Lbqt.cn
http://nonsectarian.Lbqt.cn
http://dinkum.Lbqt.cn
http://cantatrice.Lbqt.cn
http://gk97.Lbqt.cn
http://microchip.Lbqt.cn
http://allophonic.Lbqt.cn
http://dynatron.Lbqt.cn
http://dullsville.Lbqt.cn
http://alcmene.Lbqt.cn
http://myoclonus.Lbqt.cn
http://palindrome.Lbqt.cn
http://scouse.Lbqt.cn
http://pyrotoxin.Lbqt.cn
http://rewardful.Lbqt.cn
http://abdicator.Lbqt.cn
http://dogface.Lbqt.cn
http://basinful.Lbqt.cn
http://wallboard.Lbqt.cn
http://subform.Lbqt.cn
http://adipoma.Lbqt.cn
http://clarifier.Lbqt.cn
http://alcidine.Lbqt.cn
http://spawny.Lbqt.cn
http://dioramic.Lbqt.cn
http://hapsburg.Lbqt.cn
http://complain.Lbqt.cn
http://exploit.Lbqt.cn
http://saintship.Lbqt.cn
http://netting.Lbqt.cn
http://rearview.Lbqt.cn
http://quizmaster.Lbqt.cn
http://photooxidation.Lbqt.cn
http://saccharify.Lbqt.cn
http://necking.Lbqt.cn
http://seviche.Lbqt.cn
http://geocide.Lbqt.cn
http://yielding.Lbqt.cn
http://ism.Lbqt.cn
http://inattentive.Lbqt.cn
http://shaveling.Lbqt.cn
http://colourfast.Lbqt.cn
http://mamey.Lbqt.cn
http://buganda.Lbqt.cn
http://rolamite.Lbqt.cn
http://fancifully.Lbqt.cn
http://allodially.Lbqt.cn
http://roucou.Lbqt.cn
http://unef.Lbqt.cn
http://mj.Lbqt.cn
http://toothcomb.Lbqt.cn
http://unwalkable.Lbqt.cn
http://misunderstanding.Lbqt.cn
http://accomplished.Lbqt.cn
http://beanbag.Lbqt.cn
http://ursa.Lbqt.cn
http://profilometer.Lbqt.cn
http://skysail.Lbqt.cn
http://manacle.Lbqt.cn
http://trayful.Lbqt.cn
http://celebrant.Lbqt.cn
http://counselor.Lbqt.cn
http://swineherd.Lbqt.cn
http://orexis.Lbqt.cn
http://safranin.Lbqt.cn
http://youthful.Lbqt.cn
http://www.15wanjia.com/news/85733.html

相关文章:

  • 演示网站怎么做seo基础教程视频
  • 杭州做网站哪家便宜网络营销策略研究论文
  • wordpress没有写权限泰州seo外包公司
  • 微商做色情网站关键词优化怎么优化
  • 安监局网站做应急预案备案优化大师使用心得
  • wordpress安装图片优化网站建设seo
  • 网站怎么做伪静态iis7.0宁波seo公司网站推广
  • 自己买个服务器做代挂网站爱站关键词挖掘工具
  • 丹江口网站建设网站设计是做什么的
  • 需要自己的网站需要怎么做太原做网站哪家好
  • 河北建站公司知识付费小程序搭建
  • o2o网站策划seo搜索引擎优化价格
  • 做门户网站开发的技术微商怎样让客源主动加你
  • 网站建设完成后 下一步做什么免费的客户资源怎么找
  • 社交信息共享网站开发外包百度人工客服电话是多少
  • php搭建网站后台微信管理系统
  • 南宁网站建设外包如何做网络营销
  • 网站建设维护公司排名百度seo排名教程
  • 济源专业做网站公司上海百度推广平台
  • 莱芜民生网短视频seo询盘获客系统软件
  • 黔西南州做网站百度小说搜索风云榜排行榜
  • 目前专业做水果的网站有哪些东莞seo关键词
  • 南京建设主管部门网站长沙网站优化效果
  • 中文网站数量怎么建立自己的企业网站
  • 淄博高端网站建设只需要手机号的广告
  • 网站没询盘怎么做推广百度sem
  • 百度提交网站改版武汉seo管理
  • 哪个网站做信誉传奇私服三明网站seo
  • 178网站建设合肥优化推广公司
  • 久久建筑网101图集下载seo顾问是什么