Code not working

Submitting the exact code as described in the editorial but getting wrong answer on test 1. please let me know where I’m wrong

Hey @rishabhtyagi.2306
Please share your code.

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll long long
#define vii vector
#define vll vector
#define mii map<int, int>
#define mll map<ll, ll>
#define si set
#define sl set
#define umi unordered_map<int, int>
#define uml unordered_map<ll, ll>
#define usi unordered_set
#define usl unordered_set
#define maxpq priority_queue
#define minpq priority_queue<int,vii,greater()>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define pf push_front
#define mp make_pair
#define endl “\n”
#define desc greater()
#define F first
#define S second
#define mod 1000000007
#define pi 3.141592653589793238
#define setbits(x) __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
using namespace __gnu_pbds;

typedef tree<pii, null_type, less, rb_tree_tag,
tree_order_statistics_node_update> PBDS;

int main() {
FASTIO
string s, p;
cin>>s>>p;
bool dp[1001][1001];
memset(dp, 0, sizeof(dp));
int n = s.size(), m = p.size(), i, j;
dp[0][0] = 1;
for(i = 1; i <= n; i++)
{
if(p[i-1] == ‘’)
dp[0][i] = dp[0][i-2];
}
for(i = 1; i <= n; i++)
{
for(j = 1; j <= m; j++)
{
if(p[j-1] == s[i-1] && p[j-1] == ‘.’)
dp[i][j] = dp[i-1][j-1];
else if(p[j-1] == '
’)
{
dp[i][j] = dp[i][j-2];
if(p[j-2] == s[i-1] || p[j-2] == ‘.’)
dp[i][j] = (dp[i-1][j] || dp[i][j]);
}
else
dp[i][j] = 0;
}
}
cout<<dp[n][m]<<endl;
return 0;
}

Please share your code in Coding Blocks ide.

Also this shoulde be true

https://ide.codingblocks.com/s/330297

Please look into the code

Hey @rishabhtyagi.2306
aab c*a*b
Failing for test cases like this try to debug yourself first for the same

Sure I’ll get back to you if don’t find the solution. thank for the help

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

I tried debugging but couldn’t find the solution. Can you please tell me where I’m wrong

Hey I also checked your code and not able to find any error except 1 on line 49 ,It should be i<=m
Rest looks good to me ,u can reopen this doubt and some other TA will look into it :slight_smile: