Codeforce Round #422(Div 2) B
来源:互联网 发布:展锋股票指标源码 编辑:程序博客网 时间:2024/05/21 21:34
#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>using namespace std;int main(){char a[1005],b[1005];int n,m;scanf("%d %d",&n,&m);scanf("%s %s",a,b);int t=n,p=0; for(int i=0;i<=m-n;i++){int cnt=0;for(int j=0;j<n;j++){if(a[j]!=b[j+i])cnt++;}if(cnt<t) {p=i; t=cnt;}}printf("%d\n",t);int flag=0;for(int i=0;i<n;i++){if(a[i]!=b[p+i]&&flag==0) {printf("%d",i+1); flag=1;continue;}if(a[i]!=b[i+p]) printf(" %d",i+1);}printf("\n");}
阅读全文
0 0
- Codeforce Round #422(Div 2) B
- codeforce round 247 div.2 B
- 【CodeForce】Codeforces Round #140 (Div. 2) A B C
- 【CodeForce】Codeforces Round #141 (Div. 2) B. Two Tables
- 【CodeForce】Codeforces Round #142 (Div. 2) A B C
- Codeforce Round#350(Div. 2) 670B Game of Robots
- Codeforce Round #422(Div 2) A
- Codeforce Round #382(Div 1) B
- CodeForce Round #186 Div.2
- codeforce 247 div.2 B
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) B(模拟) && codeforce 724B Batch Sort
- codeforce Round #379 (Div. 2)C(贪心)
- 【codeforce】Round #402 Div.2 C
- Codeforce Round #384(Div 2)A
- Codeforce Round #384 (Div 2) C
- codeforce round 399# B
- Codeforce 214 Div 2 B.Hometask
- CODEFORCE 246 Div.2 B题
- nio 非阻塞式数据传输,服务端
- ORB-SLAM(四)追踪
- VR GunJack 学习制作
- JVM系列一(基本结构)
- 文章标题
- Codeforce Round #422(Div 2) B
- 线性模型
- 在spring boot中使用@WebFilter配置filter(包括排除URL)
- 高通平台CDT解析和制作方法
- nio 非阻塞式数据传输客户端
- ORB-SLAM(五)优化
- 我的第一个hbuilder项目
- x的根号下三次方用C++怎么打
- 1. RxJava1.x的诞生(非常重要)