cf/mirror

Subsequences of Length Two

CF
1409F2100· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
4 2
bbaa
ab
Output
3
Sample 2of 4
Input
7 3
asddsaf
sd
Output
10
Sample 3of 4
Input
15 6
qwertyhgfdsazxc
qa
Output
16
Sample 4of 4
Input
7 2
abacaba
aa
Output
15
1409F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)