当前位置:网站首页>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
边栏推荐
- Analysis of POM files
- Redis persistence
- Leetcode 1547: minimum cost of cutting sticks
- 5 minutes to understand MySQL row column conversion
- 深度学习笔记 —— 物体检测和数据集 + 锚框
- [WinUI3]編寫一個仿Explorer文件管理器
- [winui3] write an imitation Explorer file manager
- MySQL -- execution process and principle of a statement
- AQS源码阅读
- Download PDF from HowNet (I don't want to use CAJViewer anymore!!!)
猜你喜欢
MySQL slow query
2022/4/22
Independent station operation | Facebook marketing artifact - chat robot manychat
深度学习笔记 —— 数据增广
JS engine loop mechanism: synchronous, asynchronous, event loop
独立站运营 | FaceBook营销神器——聊天机器人ManyChat
Redis persistence
[winui3] write an imitation Explorer file manager
MySQL 慢查询
Deep learning notes - object detection and dataset + anchor box
随机推荐
Nacos source code startup error report solution
Define defines constants and macros, pointers and structures
Details related to fingerprint payment
HRegionServer的详解
JS determines whether the numeric string contains characters
什么是指令周期,机器周期,和时钟周期?
JS détermine si la chaîne de nombres contient des caractères
Some experience in using MySQL / tidb database [slowly updating...]
2022/4/22
Wine (COM) - basic concept
和谐宿舍(线性dp / 区间dp)
Get the number of days between dates, get the Chinese date, get the date of the next Monday of the date, get the working day, get the rest day
Backup MySQL database with Navicat
[2022 ICLR] Pyramid: low complexity pyramid attention for long range spatiotemporal sequence modeling and prediction
Redis data type usage scenario
MySQL slow query
MySQL -- execution process and principle of a statement
[database] MySQL single table query
【数据库】MySQL基本操作(基操~)
Learning Android II from scratch - activity