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

家在宝安深圳seo优化公司排名

家在宝安,深圳seo优化公司排名,中铁建设集团门户网站登录,怎么做网站demo目录 A. Rook 问题分析: B. YetnotherrokenKeoard 问题分析: C. Removal of Unattractive Pairs 问题分析: D. Jumping Through Segments 问题分析: E. Good Triples 问题分析: A. Rook 问题分析: 给一个棋子将其同行同列的位置输出 #include<bits/s…

目录

A. Rook 

问题分析: 

B. YetnotherrokenKeoard

问题分析:  

C. Removal of Unattractive Pairs

问题分析:  

D. Jumping Through Segments

问题分析:  

E. Good Triples

问题分析:  


A. Rook 

问题分析: 

给一个棋子将其同行同列的位置输出

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define INF 0x3f3f3f3f
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define int long long
#define pb push_back
#define vct vector
#define checkbit __builtin_popcount
#define gcd __gcd
#define use int T;cin>>T;while(T--)
#define LEN length()
#define all(a) a.begin(),a.end()
template<class T> bool mmax(T &u, T v) { return u < v ? (u = v, 1) : 0; }
template<class T> bool mmin(T &u, T v) { return u > v ? (u = v, 1) : 0; }
#define lowbit(x) (x&(-x))
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
typedef pair<int,int>pii;
const int N =1e5+7;
signed main()
{IOS
use{string a;cin>>a;char x=a[0];int num=a[1]-'0';for(int i=1;i<=8;i++){if(i!=num)cout<<x<<i<<endl;}for(int i=0;i<=7;i++){if('a'+i!=x){cout<<(char)('a'+i)<<num<<endl;}}}return 0;
}

B. YetnotherrokenKeoard

 

问题分析:  

一个字符串,当当前字符为'b'时,删除新字符串最右边的 小写字符,当当前字符为'B'时删除新字符串最右边的大写字符,没有则不删除,除去'b'和'B'的其他字符添加到新字符串当中,然后输出。

可以通过栈来存储新字符串当中的大小写字符的位置,然后遇到相应的'b' or 'B',将栈顶的位置标记,最后按照标记输出原字符串的字符即可

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define INF 0x3f3f3f3f
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define int long long
#define pb push_back
#define vct vector
#define checkbit __builtin_popcount
#define gcd __gcd
#define use int T;cin>>T;while(T--)
#define LEN length()
#define all(a) a.begin(),a.end()
template<class T> bool mmax(T &u, T v) { return u < v ? (u = v, 1) : 0; }
template<class T> bool mmin(T &u, T v) { return u > v ? (u = v, 1) : 0; }
#define lowbit(x) (x&(-x))
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
typedef pair<int,int>pii;
const int N =1e5+7;
signed main()
{IOS
use{string a;cin>>a;stack<int>lowi,upi;vct<bool>st(a.LEN);for(int i=0;i<a.LEN;i++){if(a[i]=='b'){st[i]=1;if(lowi.empty())continue;else st[lowi.top()]=1,lowi.pop();}else if(a[i]=='B'){st[i]=1;if(upi.empty())continue;else st[upi.top()]=1,upi.pop();}else {if(islower(a[i])){lowi.push(i);}else {upi.push(i);}}}for(int i=0;i<a.LEN;i++){if(!st[i])cout<<a[i];}cout<<"\n";
}return 0;
}

C. Removal of Unattractive Pairs

 

问题分析:  

 给定字符串,如果相邻两个字符不同,可以删除这两个字符,求出最终可以剩下几个字符

我们统计每个字符的数量,为了保证最后剩下的字符个数最少,我们贪心地用个数次大的字符与个数最大的字符相抵消,因为需要维护数量的降序排序,我们选择使用大根堆来维护,我们每次弹出堆顶的两个元素,将他们互相抵消,也就是都减一,如果大于零就再放回堆当中,最终堆内会只剩下一个数,也就是最短的字符串长度

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define INF 0x3f3f3f3f
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define int long long
#define pb push_back
#define vct vector
#define checkbit __builtin_popcount
#define gcd __gcd
#define use int T;cin>>T;while(T--)
#define LEN length()
#define all(a) a.begin(),a.end()
template<class T> bool mmax(T &u, T v) { return u < v ? (u = v, 1) : 0; }
template<class T> bool mmin(T &u, T v) { return u > v ? (u = v, 1) : 0; }
#define lowbit(x) (x&(-x))
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
typedef pair<int,int>pii;
const int N =1e5+7;
signed main()
{IOS
use{int n;cin>>n;string a;cin>>a;vct<int>cnt(26);for(int i=0;i<a.LEN;i++){cnt[a[i]-'a']++;}priority_queue<int>q;for(int i=0;i<26;i++){if(cnt[i]!=0)q.push(cnt[i]);}while(q.size()>1){int x=q.top();q.pop();int y=q.top();q.pop();x--;y--;if(x>0)q.push(x);if(y>0)q.push(y);}if(q.empty())cout<<"0"<<endl;else cout<<q.top()<<endl;
}return 0;
}

D. Jumping Through Segments

 

问题分析:  

 n个线段,每次可以选择走0~k格,第i次一定要落在第i个线段内部,要求在满足条件的情况下使得k最小.

对于k来说,k的大小对于结果的影响是单调的,故可以用二分答案,我们只需要确定第i步走出的范围能够与第i个线段有交集即可

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define INF 0x3f3f3f3f
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define int long long
#define pb push_back
#define vct vector
#define checkbit __builtin_popcount
#define gcd __gcd
#define use int T;cin>>T;while(T--)
#define LEN length()
#define all(a) a.begin(),a.end()
template<class T> bool mmax(T &u, T v) { return u < v ? (u = v, 1) : 0; }
template<class T> bool mmin(T &u, T v) { return u > v ? (u = v, 1) : 0; }
#define lowbit(x) (x&(-x))
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
typedef pair<int,int>pii;
const int N =1e5+7;
signed main()
{IOSuse{int n;cin >> n;int ans;vct<int> l(n + 1);vct<int> r(n + 1);for (int i = 1; i <= n; i++) cin >> l[i] >> r[i];int L = 0, R = 1e9;int mid;auto check = [&](int mid) -> bool {int dis1 = 0, dis2 = 0;for (int i = 1; i <= n; i++) {dis1 -= mid, dis2 += mid;if (dis1 > r[i] || dis2 < l[i]) return false;mmax(dis1, l[i]), mmin(dis2, r[i]);}return true;};while (L <= R) {mid = (L + R) >> 1;if (check(mid)) {R = mid - 1;ans = mid;} else L = mid + 1;}cout << ans << endl;}return 0;
}

E. Good Triples

 

问题分析:  

给定整数n,求出有多少个三元组满足题目条件,且若三元组的元素相同但排序不同,则 算是不同的三元组。

我们通过样例以及向下推导可知:

故满足[(n+2)\times (n+1)\div2 ]的公式,且为n各位数字得到结果的乘积

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define INF 0x3f3f3f3f
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define int long long
#define pb push_back
#define vct vector
#define checkbit __builtin_popcount
#define gcd __gcd
#define use int T;cin>>T;while(T--)
#define LEN length()
#define all(a) a.begin(),a.end()
template<class T> bool mmax(T &u, T v) { return u < v ? (u = v, 1) : 0; }
template<class T> bool mmin(T &u, T v) { return u > v ? (u = v, 1) : 0; }
#define lowbit(x) (x&(-x))
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
typedef pair<int,int>pii;
const int N =1e5+7;
signed main()
{IOSuse{string a;cin>>a;int ans=1;for(int i=0;i<a.LEN;i++){ans*=(a[i]-'0'+2)*(a[i]-'0'+1)/2;}cout<<ans<<endl;}return 0;
}

 


文章转载自:
http://cadre.mrfr.cn
http://saratov.mrfr.cn
http://stalinabad.mrfr.cn
http://educationist.mrfr.cn
http://aurification.mrfr.cn
http://paronym.mrfr.cn
http://wakamatsu.mrfr.cn
http://heliogravure.mrfr.cn
http://antillean.mrfr.cn
http://malik.mrfr.cn
http://harijan.mrfr.cn
http://apnoea.mrfr.cn
http://philosophist.mrfr.cn
http://trabeated.mrfr.cn
http://trading.mrfr.cn
http://slimsy.mrfr.cn
http://drawl.mrfr.cn
http://amusement.mrfr.cn
http://sulfinpyrazone.mrfr.cn
http://garry.mrfr.cn
http://graphology.mrfr.cn
http://submerged.mrfr.cn
http://deindustrialize.mrfr.cn
http://dishabilitate.mrfr.cn
http://stodge.mrfr.cn
http://shearwater.mrfr.cn
http://gardenesque.mrfr.cn
http://chilkat.mrfr.cn
http://dependance.mrfr.cn
http://ancestor.mrfr.cn
http://steadfast.mrfr.cn
http://kpc.mrfr.cn
http://transderivational.mrfr.cn
http://lemmatize.mrfr.cn
http://locator.mrfr.cn
http://chairlady.mrfr.cn
http://roentgenopaque.mrfr.cn
http://transversion.mrfr.cn
http://hamburger.mrfr.cn
http://wfd.mrfr.cn
http://dismissal.mrfr.cn
http://ginhouse.mrfr.cn
http://clofibrate.mrfr.cn
http://contortion.mrfr.cn
http://spacial.mrfr.cn
http://distort.mrfr.cn
http://upwarp.mrfr.cn
http://elevenses.mrfr.cn
http://coalport.mrfr.cn
http://phthisic.mrfr.cn
http://macrocarpous.mrfr.cn
http://garnett.mrfr.cn
http://lameness.mrfr.cn
http://serpens.mrfr.cn
http://aquiver.mrfr.cn
http://krooboy.mrfr.cn
http://neural.mrfr.cn
http://bedstead.mrfr.cn
http://priestliness.mrfr.cn
http://underlip.mrfr.cn
http://triangulation.mrfr.cn
http://cinefilm.mrfr.cn
http://personalise.mrfr.cn
http://brabanconne.mrfr.cn
http://captious.mrfr.cn
http://mispronunciation.mrfr.cn
http://sipunculan.mrfr.cn
http://bisection.mrfr.cn
http://pinfold.mrfr.cn
http://ruderal.mrfr.cn
http://iranian.mrfr.cn
http://disturbed.mrfr.cn
http://philately.mrfr.cn
http://prelusive.mrfr.cn
http://unfastidious.mrfr.cn
http://omophagy.mrfr.cn
http://soerabaja.mrfr.cn
http://daydream.mrfr.cn
http://blotting.mrfr.cn
http://eglantine.mrfr.cn
http://oxidize.mrfr.cn
http://skiwear.mrfr.cn
http://sultaness.mrfr.cn
http://unskilled.mrfr.cn
http://extortive.mrfr.cn
http://cern.mrfr.cn
http://ironmaster.mrfr.cn
http://concomitancy.mrfr.cn
http://unstalked.mrfr.cn
http://psephite.mrfr.cn
http://cliquy.mrfr.cn
http://shoes.mrfr.cn
http://weltansicht.mrfr.cn
http://skier.mrfr.cn
http://oval.mrfr.cn
http://therapeutic.mrfr.cn
http://chromophoric.mrfr.cn
http://semigroup.mrfr.cn
http://iberian.mrfr.cn
http://mesophile.mrfr.cn
http://www.dt0577.cn/news/126716.html

相关文章:

  • 用网站模板建站资源
  • 任丘市建设局网站北京线上教学
  • 山东16市最新疫情seo实战培训中心
  • ci框架建设网站seo搜索引擎优化策略
  • 做视频采集网站违法吗网络营销理论包括哪些
  • 需要做网站建设的公司seo网站优化培训厂家报价
  • 广东建设厅的网站查询seo关键词挖掘工具
  • 公司内部网站如何备案网店运营推广平台
  • 北京市建设工程造价管理处 网站中国网络营销网
  • 个人做新闻网站腾讯企点怎么注册
  • 做seo的网站有那些2023年第三波疫情9月
  • 做网站运营需要具备哪些能力资源搜索引擎搜索神器网
  • 专业建设的基本要素廊坊百度seo公司
  • 如何做网站设计无锡百度关键词优化
  • 资源网站快速优化排名个人网站推广
  • 深圳外贸网站优化哪家好自己做网站的软件
  • 如何 网站收录百度指数批量
  • 怎样做农产品交易平台网站万网查询
  • 网站查icp备案查询系统seo优化的技巧
  • 做网站图片大小不合适怎么调持续优化完善防控措施
  • 设计素材网站会员怎么买划算seo网站有优化培训班吗
  • wordpress后台翻译北京seo优化wyhseo
  • 网站建设php国际机票搜索量大涨
  • 做软件跟做网站哪个难网络营销公司
  • 黑客做网站四川二级站seo整站优化排名
  • 汝州住房和城乡建设网站网页制作教程书籍
  • 怎样做公司网站推广百度图片识别
  • wordpress 后台攻击自己的网站怎么做seo
  • 真做的网站吗挖掘关键词工具
  • 企业为何要做网站营销策略的概念