For this Question: Given a number N in the form of a string, find the number of its good substrings.
A good substring is a substring that is divisible by the given prime p. A good substring can start with a 0.The first line of input contains a single number, the length of the string, |N|
The second line of input contains the number N.
The third and final line of input contains a prime number p.

Constraints
1 <= |N| <= 100000
2 <= p <= 10000
p is a prime numberThe only line of output contains the number of good substrings.Sample Input
4
3543
3

Sample Output
6

Explanation
Good substrings are 3, 354, 3543, 54, 543, 3, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define int long long
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
#define INF 1000000000000000007LL

const int N = 100005;
 
// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n; cin>>n;
    string s; cin>>s;
    int p; cin>>p;
    int arr[p+1];
    memset(arr, 0, sizeof(arr));
    arr[0]=1;
    int mult = 1;
    int cur = 0;
    int ans = 0;
    if (p == 2 || p == 5){
        for (int i = n-1; i >= 0; --i){
            if ((s[i]-'0') % p == 0){
                ans += i + 1;
            }
        }
        cout<<ans;
        return 0;
    }
    for(int i=n-1; i>=0; i--){
        int a = s[i]-'0';
        a *= mult;
        a %= p;
        cur += a;
        cur %= p;
        ans += arr[cur];
        // trace(ans);
        arr[cur]++;
        mult *= 10;
        mult %= p;
    }
    cout<<ans;
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?