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

定海建设规划网站室内设计作品

定海建设规划网站,室内设计作品,慈溪电商网站建设公司,如何制作出优秀的ui设计A. 恶心模拟。。 模拟一下分类即可 数字类&#xff0c;数字0&#xff0c;或者都是数字 字母类&#xff0c;字母空的也是字母&#xff0c;有字母就是字母 #include<bits/stdc.h> #define INF 1e9 using namespace std; typedef long long ll; const int N2e59; strin…

A.

恶心模拟。。

模拟一下分类即可

数字类,数字0,或者都是数字

字母类,字母空的也是字母,有字母就是字母

#include<bits/stdc++.h>
#define INF 1e9
using namespace std;
typedef long long ll;
const int N=2e5+9;
string number[N],capital[N];
int number_pos,capital_pos;
void lan(){string s;cin>>s;s+=";";string s1="";for(int i=0;i<s.size();){s1="";while(i<s.size() && s[i]!=',' && s[i]!=';'){//读取完整s1+=s[i];i++;}if(s1==""){//字母capital[++capital_pos]=s1;i++;continue;}if(s1=="0"){//数字number[++number_pos]=s1;}else if(s1[0]=='0'){//01capital[++capital_pos]=s1;}else{//全是数字才是数字,其他都是字母bool flag=true;for(int j=0;j<s1.size();j++){if(s1[j]<'0' || s1[j]>'9'){flag=false;break;}}if(flag){number[++number_pos]=s1;}else{capital[++capital_pos]=s1;}}i++;}if(!number_pos){//没有就-cout<<"-";}else{//输出前n-1一个cout<<"\"";for(int i=1;i<number_pos;i++){cout<<number[i]<<",";}cout<<number[number_pos]<<"\"";//最后一个特别处理}cout<<'\n';if(!capital_pos){cout<<"-";}else{cout<<"\"";for(int i=1;i<capital_pos;i++){cout<<capital[i]<<",";}cout<<capital[capital_pos]<<"\"";}
}
int main(){ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);int q=1;while(q--){lan();}return 0;
}

B.

二分upper_bound就好了

#include<bits/stdc++.h>
#define INF 1e9
using namespace std;
typedef long long ll;
const int N=2e5+9;
int a[N],b[N];
int n,m;
int work(int x){return upper_bound(a+1,a+1+n,x)-a-1;
}
void lan(){cin>>n>>m;for(int i=1;i<=n;i++){cin>>a[i];}for(int i=1;i<=m;i++){cin>>b[i];}sort(a+1,a+1+n);for(int i=1;i<=m;i++){cout<<work(b[i])<<" ";}}
int main(){ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);int q=1;while(q--){lan();}return 0;
}

C.

贪心,大的且只有奇数数量就变成小的,回文串对称特性所以用栈模拟后半段即可

#include<bits/stdc++.h>
#define INF 1e9
using namespace std;
typedef long long ll;
const int N=2e5+9;
int c[N];
void lan(){string s;cin>>s;int n=s.length();for(int i=0;i<n;i++){//桶存c[s[i]-'a']++;}for(int i=25;i>=0;i--){//倒着找,找到的肯定是最大的if(c[i]&1){for(int j=0;j<26;j++){if(c[j]&1){//正着找,找到的肯定是最小的,但是也有可能找不到  abac[j]++;c[i]--;break;}}}}int flag=-1;//记录中间字母for(int i=0;i<26;i++){if(c[i]&1){flag=i;}}stack<char> stk;//栈模拟后面for(int i=0;i<26;i++){//找最小必然字典序最小for(int j=1;j<=c[i]/2;j++){cout<<char(i+'a');stk.push(char(i+'a'));}}//aabbif(flag!=-1){cout<<char(flag+'a');//输出中间}//倒着输出即可while(!stk.empty()){cout<<stk.top();stk.pop();}
}
int main(){ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);int q=1;while(q--){lan();}return 0;
}

http://www.yayakq.cn/news/797163/

相关文章:

  • 郑州营销型网站设计东莞网站设计方案
  • 广东新闻联播吴姗姗企业网站优化排名方案
  • 站长统计幸福宝网站统计ai论文生成器免费
  • 在哪个网站做失业分解中国建筑网官网云筑网
  • 合肥门户网站制作建设dedecms5.7装饰网站模板
  • 百度收录网站方法wordpress论坛化插件
  • 阜阳建设网站公司电话网站开发公司商业计划书
  • 东莞做网站dgjcwl网站建设与维护蒋勇从
  • 自己做视频网站能赚钱吗seo下拉优化
  • 湖南做网站磐石网络深圳招聘网官方网站
  • 有哪些做h5的网站怎么在网站上放广告
  • 郴州网站建设软件定制开发制作本科自考报名官网
  • 南通物流网站建设西安招聘网
  • 美容网站建设一个多少钱wordpress 企业主题下载
  • 网站建设单子邮箱账号做网站用户名好不好
  • 如何优化公司的网站途牛网站大数据建设
  • 青白江建设网站wordpress 1核2g的服务器卡
  • 网站投稿源码营销型网站搭建公司
  • asp装饰公司网站源码saas和wordpress
  • 怎么用优盘做网站登录密钥wordpress移动端插件menu
  • 软件制作需要多少钱西安网站seo费用
  • 怎样做私人网站百度小程序下载
  • 网站建设部岗位职责专业的网站建设公
  • 网站开发好了 怎么发布西安优秀的定制网站建设公司哪家好
  • 信息发布网站怎么做玉林网站建设
  • 简述织梦网站上传及安制作钓鱼网站教程源码
  • 开发建设信息的网站网站建设实施步骤
  • 咸阳制作网站WordPress主题zero
  • 网站建设 业务员提成cms内容网站管理系统
  • 网站备案信息的核查方式wordpress知识付费模板