Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cin >> l >> m;
- cin >> s1 >> s2;
- if(s1.length() + s2.length() < l) {
- cout << (2 * powmod(26,l-s1.length() - s2.length(),m)) % m << endl;
- continue;
- }
- if(s1.length() + s2.length() == l) {
- cout << 1 << endl;
- continue;
- }
- if(is(s1,s2,l) && is(s2,s1,l)) {cout << 2 << endl; continue;}
- if(is(s1,s2,l) || is(s2,s1,l)) {cout << 1 << endl; continue;}
- cout << 0 << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement