This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include <bits/stdc++.h>
using namespace std;
int n, m, k;
string s;
int res;
/*
4 3 100
111
答案:81
*/
void dfs(int u, string t) {
if (u == n) {
if (t.find(s) == string::npos) res++;
res = res % k;
return;
}
for (int i = 0; i <= 9; i++) {
t.push_back(i + '0');
dfs(u + 1, t);
t.pop_back();
int main() {
cin >> n >> m >> k;
cin >> s;
dfs(0, "");
printf("%d\n", res);
return 0;