当前位置:网站首页>蓝桥杯2019年国赛最长子序列
蓝桥杯2019年国赛最长子序列
2022-06-22 14:25:00 【Stephen_Curry___】
题目链接:
链接: 最长子序列.
思路
一看到求最长子序列即可想到用双指针算法来求解,题目很简单,模拟一下就可以了。
C++代码
#include<bits/stdc++.h>
using namespace std;
int main(){
string s1, s2;
cin >> s1 >> s2;
int len = 0;
for(int i = 0, j = 0; i < s1.size(); i++){
if(s1[i] == s2[j]){
j++;
len++;
}
}
cout << len;
return 0;
}
边栏推荐
- [Zhejiang University] information sharing of the first and second postgraduate entrance examinations
- FreeRTOS task priority and interrupt priority
- Phpstudy 2016 build Pikachu range
- 鸿世电器冲刺创业板:年营收6亿 刘金贤股权曾被广德小贷冻结
- Ask if you want to get the start of sqlserver_ Is there a good way for LSN?
- 接了个私活项目,一下赚了15250,还有必要做主业吗?
- Reconstruction practice of complex C-end project of acquisition technology
- What are the five characteristics of network security? What are the five attributes?
- Wallys/DR7915-wifi6-MT7915-MT7975-2T2R-support-OpenWRT-802.11AX-supporting-MiniPCIe
- KEIL仿真和vspd
猜你喜欢

What is the value of a website? Why build an independent station

After 100 days, Xiaoyu built a robot communication community!! Now invite moderators!

【直播回顾】战码先锋第六期:共建测试子系统,赋能开发者提

得物App数据模拟平台的探索和实践

New hybrid architecture iformer! Flexible migration of convolution and maximum pooling to transformer

Verilog使用inout信号的方法

封装api时候token的处理

FPGA collects DHT11 temperature and humidity

我靠副业一年全款买房:那个你看不起的行业,未来十年很赚钱!

Self inspection is recommended! The transaction caused by MySQL driver bug is not rolled back. Maybe you are facing this risk!
随机推荐
U++ programming array learning notes
数据库连接池:代码目录
“软件定义世界,开源共筑未来” 2022开放原子全球开源峰会7月底即将开启
What happened to those who didn't go to college
2022年失业的人多吗?今年是不是特别难找工作?
The IPO of Tian'an technology was terminated: Fosun and Jiuding were shareholders who planned to raise 350million yuan
Yilian technology rushes to Shenzhen Stock Exchange: annual revenue of RMB 1.4 billion, 65% of which comes from Ningde times
ML笔记-matrix fundamental, Gradient Descent
乱解码nlp
How MySQL modifies a field to not null
向量1(类和对象)
模板特例化 template<>
MongoDB在腾讯零售优码中的应用
Simulation Keil et vspd
『忘了再学』Shell流程控制 — 38、while循环和until循环介绍
flutter video_player實現監聽和自動播放下一首歌曲
Token processing during API encapsulation
Reconstruction practice of complex C-end project of acquisition technology
Is the encryption market a "natural disaster" or a "man-made disaster" in the cold winter?
SDVO:LDSO+语义,直接法语义SLAM(RAL 2022)