当前位置:网站首页>Flip coin (Blue Bridge Cup)
Flip coin (Blue Bridge Cup)
2022-04-23 05:08:00 【FOWng_ lp】



AC code
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
string a,b;
int l=-1,r,ans;
int main(){
cin >> a >> b;
for(int i = 0;i < a.size();i++){
if(a[i]!=b[i]){
if(l==-1)l = i;
else {
ans += (i-l);
l=-1;
}
}
}
cout << ans << endl;
return 0;
}
版权声明
本文为[FOWng_ lp]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220549345557.html
边栏推荐
- Redis lost key and bigkey
- Machine learning - linear regression
- Acid of MySQL transaction
- Day.js 常用方法
- 【数据库】MySQL单表查询
- Chapter III project schedule management of information system project manager summary
- C. Tree Infection(模拟+贪心)
- 【数据库】表的查看、修改和删除
- Summary of MySQL knowledge points
- COM in wine (2) -- basic code analysis
猜你喜欢
![[2021] Spatio-Temporal Graph Contrastive Learning](/img/7d/67a0bfa0adecee24bbe291a25ae906.png)
[2021] Spatio-Temporal Graph Contrastive Learning

Details related to fingerprint payment

Redis data type usage scenario

Detailed explanation of the differences between TCP and UDP

Spell it! Two A-level universities and six B-level universities have abolished master's degree programs in software engineering!
![[winui3] Écrivez une copie du gestionnaire de fichiers Explorer](/img/3e/62794f1939da7f36f7a4e9dbf0aa7a.png)
[winui3] Écrivez une copie du gestionnaire de fichiers Explorer

Sword finger offer: the median in the data stream (priority queue large top heap small top heap leetcode 295)
![[WinUI3]编写一个仿Explorer文件管理器](/img/3e/62794f1939da7f36f7a4e9dbf0aa7a.png)
[WinUI3]编写一个仿Explorer文件管理器

How can continuous integration (CI) / continuous delivery (CD) revolutionize automated testing

At pgconf Asia Chinese technology forum, listen to Tencent cloud experts' in-depth understanding of database technology
随机推荐
Innovation training (XI) airline ticket crawling company information
In aggregated query without group by, expression 1 of select list contains nonaggregated column
洛谷P2731骑马修栅栏
深度学习笔记 —— 语义分割和数据集
Sword finger offer: the path with a certain value in the binary tree (backtracking)
Innovation training (XII) reptile
Machine learning - linear regression
Redis persistence
Making message board with PHP + MySQL
Progress of innovation training (III)
Independent station operation | Facebook marketing artifact - chat robot manychat
HRegionServer的详解
Deep learning notes - fine tuning
The difference between static pipeline and dynamic pipeline
和谐宿舍(线性dp / 区间dp)
Streamexecutionenvironment of Flink source code
[winui3] write an imitation Explorer file manager
Learning Android from scratch -- baseactivity and activitycollector
PHP counts the number of files in the specified folder
什么是指令周期,机器周期,和时钟周期?