Codeforces Round #422 (Div. 2), problem: (B) Crossword solving Solution In C/C++

By | 2017-07-25T08:59:31+00:00 July 25th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#include<bits/stdc++.h> using namespace std; int n,m,i,j,c,a=2e9,ai; string s,t; int main(){ cin>>n>>m>>s>>t; for(i=0;i<=m-n;i++) { for(c=j=0;j<n;j++) t[i+j]==s[j]?0:c++; c<a?a=c,ai=i:0; } cout<<a<<endl; for(c=j=0;j<n;j++) t[ai+j]!=s[j]?cout<<j+1<<" ",0:0; }