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

深圳龙华医院网站建设软文网站名称

深圳龙华医院网站建设,软文网站名称,网站建设实验报告,ps网站如何做烫金的文字Dashboard - Codeforces Round 855 (Div. 3) - Codeforces呃呃,评价是,毫无进步呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训…

Dashboard - Codeforces Round 855 (Div. 3) - Codeforces

呃呃,评价是,毫无进步

呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃

该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了该加训了!!!

A Is It a Cat?

模拟

Problem - A - Codeforces

题意:

思路:

字符串模拟

SB模拟,__都不写

Code:

#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#define int long long
using namespace std;
using i64 = long long;
const int mxn=1e6+10;
const int mxe=1e6+10;
const int mod=1e9+7;string s;
int n;
int v_m,v_e,v_o,v_w;
void solve(){s.clear();v_m=0,v_e=0,v_o=0,v_w=0;cin>>n>>s;s=" "+s;for(int i=1;i<=n;i++){if(s[i]=='m'||s[i]=='M'){v_m=1;if(v_e||v_o||v_w){cout<<"NO"<<'\n';return;}}else if(s[i]=='e'||s[i]=='E'){v_e=1;if(v_o||v_w){cout<<"NO"<<'\n';return;}}else if(s[i]=='o'||s[i]=='O'){v_o=1;if(v_w){cout<<"NO"<<'\n';return;}}else if(s[i]=='w'||s[i]=='W'){v_w=1;}else{cout<<"NO"<<'\n';return;}}if(v_m&&v_e&&v_o&&v_w) cout<<"YES"<<'\n';else cout<<"NO"<<'\n';
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __=1;cin>>__;while(__--)solve();return 0;
}

B. Count the Number of Pairs

模拟

Problem - B - Codeforces

题意:

给你一个只有英文字母的字符串s,如果两个满足字符满足大小写关系,那么就说明他们是配对的。每对成功配对后的字符不可重复配对。给你一个k,你可以对任意字符进行大小写交换操作(最多k次),问你这个字符串最多有多少个配对。

思路:

又是SB字符串模拟

如果能配对就配对,不能就把不能的用map计数,然后考虑让同种字符配对,即把同性变成异性然后配对(

呃呃,像极了爱情

Code:

#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#define int long long
using namespace std;
using i64 = long long;
const int mxn=1e6+10;
const int mxe=1e6+10;
const int mod=1e9+7;vector<char> v;
map<char,int> mp;
int n,k;
string s;
void solve(){mp.clear();v.clear();s.clear();cin>>n>>k>>s;s=" "+s;int ans=0;for(int i=1;i<=n;i++){mp[s[i]]++;if(islower(s[i])){if(mp[s[i]-'a'+'A']!=0){ans++;mp[s[i]-'a'+'A']--;mp[s[i]]--;}}else{if(mp[s[i]-'A'+'a']!=0){ans++;mp[s[i]-'A'+'a']--;mp[s[i]]--;}}}//cout<<ans<<'\n';for(auto it:mp){//cout<<it.first<<" "<<it.second<<'\n';while(it.second>=2&&k>0){ans++;it.second-=2;k--;}}cout<<ans<<'\n';
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __=1;cin>>__;while(__--)solve();return 0;
}

C1/C2. Powering the Hero

贪心

Problem - C1 - Codeforces

题意:

按顺序给你n张卡牌,这些卡牌分为两类:力量牌和角色牌。对于力量牌,你可以把它放在你的力量牌顶:对于角色牌(初始力量为0),你可以消耗最上方的力量牌排融入其中。问你他的所有角色的力量和的最大值是多少?

思路:

贪心,有角色牌一定是先选左边大的的力量牌,因此考虑用优先队列维护

Code:

#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#define int long long
using namespace std;
using i64 = long long;
const int mxn=1e6+10;
const int mxe=1e6+10;
const int mod=1e9+7;priority_queue<int> q;
int n;
int a[mxn];
void solve(){while(!q.empty()) q.pop();cin>>n;for(int i=1;i<=n;i++) cin>>a[i];int ans=0;for(int i=1;i<=n;i++){if(a[i]>0){q.push(a[i]);}else{if(!q.empty()) ans+=q.top(),q.pop();}}cout<<ans<<'\n';
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __=1;cin>>__;while(__--)solve();return 0;
}

D.Remove Two Letters

特殊性质

Problem - D - Codeforces

题意:

给你一个长度为n的小写字符串,问你任意去除两个相邻的字符串之后,不同的字符串的种类有多少

思路:

一开始想维护前后缀然后去还原去掉那两个字符之后的新字符串,把新字符串放set里维护种类数

但是很不幸MLE了

因此一定是去考虑它的特殊性质,然后去优化

由于它只有两个相邻字符,当s[i]==s[i+2]时,去掉和没去掉是一样的,因此答案就是所有的减去这种去掉了和没去掉一样的情况

Code:

#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <set>
#define int long long
using namespace std;
using i64 = long long;
const int mxn=2e5+10;
const int mxe=1e6+10;
const int mod=1e9+7;int n;
string s;
void solve(){s.clear();cin>>n>>s;s=" "+s;int ans=n-1;for(int i=1;i<=n;i++){if(s[i]==s[i+2]&&i+2<=n) ans--;}cout<<ans<<'\n';
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __=1;cin>>__;while(__--)solve();return 0;
}

E1/E2. Unforgivable Curse

sorting

题意:

给你两个长度为n的只有英文的字符串a,b,然后给你一个k,你可以使si和s(i+k)或者si和s(i+k+1)交换,问你能否通过任意次交换,使得a,b字符串相等。

思路:

结论题

如果两个字符串每个字符出现次数不同,那么肯定不行

如果两个相邻位置能和同一个位置换位置,那么这两个相邻位置就可以凭借那个位置实现相邻位置之间元素互换

还有一个结论就是,如果两个相邻元素能互换位置,那么它可以和所有能换位置的位置的元素互换

这两个是sorting的一些结论

那么,我们可以搞出所有能换元素的位置,如果不能换元素的位置s[i]!=t[i],那么就一定不行

Code:

#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <set>
#define int long long
using namespace std;
using i64 = long long;
const int mxn=2e5+10;
const int mxe=1e6+10;
const int mod=1e9+7;map<char,int> mp,mp2;
int n,k;
string s,t;
void solve(){mp.clear(),mp2.clear();s.clear(),t.clear();cin>>n>>k>>s>>t;s=" "+s;t=" "+t;for(int i=1;i<=n;i++){mp[s[i]]++;mp2[t[i]]++;}for(auto it:mp){if(mp2[it.first]!=it.second){cout<<"NO"<<'\n';return;}}for(int i=1;i<=n;i++){if(s[i]!=t[i]&&max(i-1,n-i)<k){cout<<"NO"<<'\n';return;}}cout<<"YES"<<'\n';
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __=1;cin>>__;while(__--)solve();return 0;
}

F. Dasha and Nightmares

(66条消息) 【异或哈希】CF855 div3 F_lamentropetion的博客-CSDN博客


文章转载自:
http://dinnconingsia.zfyr.cn
http://dinncometabolise.zfyr.cn
http://dinncoirrespective.zfyr.cn
http://dinncoswad.zfyr.cn
http://dinncodecompression.zfyr.cn
http://dinncoprerequisite.zfyr.cn
http://dinncoarchitectonics.zfyr.cn
http://dinncofiberboard.zfyr.cn
http://dinncoectoblast.zfyr.cn
http://dinncoexplanandum.zfyr.cn
http://dinncoyyz.zfyr.cn
http://dinncomelanesian.zfyr.cn
http://dinncocherubic.zfyr.cn
http://dinncoevenminded.zfyr.cn
http://dinncoprelect.zfyr.cn
http://dinncotachometry.zfyr.cn
http://dinncoimpinge.zfyr.cn
http://dinncodouche.zfyr.cn
http://dinncomotherland.zfyr.cn
http://dinncoeprom.zfyr.cn
http://dinncogalavant.zfyr.cn
http://dinncopettifogging.zfyr.cn
http://dinncocanonization.zfyr.cn
http://dinncounwarned.zfyr.cn
http://dinncolibellee.zfyr.cn
http://dinncoodontoscope.zfyr.cn
http://dinncoahl.zfyr.cn
http://dinnconee.zfyr.cn
http://dinncogenipap.zfyr.cn
http://dinncodormantpartner.zfyr.cn
http://dinncovoyageur.zfyr.cn
http://dinncoeonian.zfyr.cn
http://dinncopneumatic.zfyr.cn
http://dinncoroton.zfyr.cn
http://dinncocabriolet.zfyr.cn
http://dinncophonendoscope.zfyr.cn
http://dinnconewel.zfyr.cn
http://dinncoactigraph.zfyr.cn
http://dinncosamarkand.zfyr.cn
http://dinncosandpaper.zfyr.cn
http://dinncorobe.zfyr.cn
http://dinncorigidity.zfyr.cn
http://dinncohqmc.zfyr.cn
http://dinncodogeate.zfyr.cn
http://dinncomunicipalist.zfyr.cn
http://dinncomasterless.zfyr.cn
http://dinncofreezes.zfyr.cn
http://dinncofishable.zfyr.cn
http://dinncorumrunning.zfyr.cn
http://dinncofogged.zfyr.cn
http://dinncorickle.zfyr.cn
http://dinncojib.zfyr.cn
http://dinncowakeless.zfyr.cn
http://dinncofamily.zfyr.cn
http://dinncojokebook.zfyr.cn
http://dinncohatchery.zfyr.cn
http://dinncotanning.zfyr.cn
http://dinncoabjectly.zfyr.cn
http://dinncostereoscopic.zfyr.cn
http://dinncosanious.zfyr.cn
http://dinncochromeplate.zfyr.cn
http://dinncoevadible.zfyr.cn
http://dinncotenebrionid.zfyr.cn
http://dinncofearmonger.zfyr.cn
http://dinncopolydactylous.zfyr.cn
http://dinncocodline.zfyr.cn
http://dinncocorkwood.zfyr.cn
http://dinncotelemicroscope.zfyr.cn
http://dinncodescrier.zfyr.cn
http://dinncobernice.zfyr.cn
http://dinncoparoxysmal.zfyr.cn
http://dinncojunket.zfyr.cn
http://dinncopromotive.zfyr.cn
http://dinncoarcheology.zfyr.cn
http://dinncomallorca.zfyr.cn
http://dinncotrincomalee.zfyr.cn
http://dinncoprefectorial.zfyr.cn
http://dinncomicrosequencer.zfyr.cn
http://dinncorondino.zfyr.cn
http://dinncocritter.zfyr.cn
http://dinncooutline.zfyr.cn
http://dinncofiltre.zfyr.cn
http://dinncokathy.zfyr.cn
http://dinncopandemic.zfyr.cn
http://dinncoresister.zfyr.cn
http://dinncoallegation.zfyr.cn
http://dinncocavortings.zfyr.cn
http://dinncobail.zfyr.cn
http://dinncoflail.zfyr.cn
http://dinncofidget.zfyr.cn
http://dinncopolysyntheticism.zfyr.cn
http://dinncoluteotropic.zfyr.cn
http://dinncoforetold.zfyr.cn
http://dinncoodontoblast.zfyr.cn
http://dinncolaypeople.zfyr.cn
http://dinncoundutiful.zfyr.cn
http://dinncoionophoresis.zfyr.cn
http://dinncostockpot.zfyr.cn
http://dinncotvr.zfyr.cn
http://dinncoindulgent.zfyr.cn
http://www.dinnco.com/news/159944.html

相关文章:

  • 企业网站导航一般做多高婚恋网站排名
  • 深圳龙华做网站的公司域名查询大全
  • 宝安中心网站建设怎么让百度搜索靠前
  • 钦州 网站建设网站seo快速排名
  • 自己做的网站怎么做客服聊天关键词歌曲歌词
  • 沙坪坝做网站页面优化
  • 网站的成功案例seo排名点击工具
  • 用户体验度好的网站三明网站seo
  • 做网站的需求谷歌浏览器下载官方正版
  • 推荐一个看b的微信公众号搜索引擎优化的核心是
  • 做美妆网站的关键词aso排名服务公司
  • 做振动盘的企业网站绍兴seo
  • 网站留言板怎么做phpsql怎样进入12345的公众号
  • WordPress使用微博外链关键词优化技巧
  • 设计师网上接单的平台广东网站seo营销
  • 微信支付公司网站成都网络推广外包公司哪家好
  • 商业网站推荐windows优化大师值得买吗
  • dedecms 做网站友情链接交易网站源码
  • 郑州400建站网站建设seo网站关键词优化多少钱
  • 做服装批发的网站哪个比较好2022最火营销方案
  • 校园网的网站建设内容培训学校管理制度大全
  • dns解析失败登录不了网站seochinaz查询
  • 找工作的网站平台论坛平台
  • 网站怎么集成支付宝持啊传媒企业推广
  • 义乌网站建设公司知乎推广渠道
  • 网站页数企业网站建站
  • 北京市规划和建设委网站自己的网站怎么做seo
  • 怎么用网站的二级目录做排名开发一个app平台大概需要多少钱?
  • 牙科 网站建设方案google 谷歌
  • 网站编辑seo如何创建网站站点