Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n, m;
- string s, t;
- cin>>n>>m>>s>>t;
- int x = (t.substr(0, n)==s);
- int y = 2*(t.substr(m-n, n)==s);
- if(x+y == 3) x=0, y=0;
- else if(x+y == 0) x=3, y=0;
- cout<<x+y<<"\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement