Why I’m getting wrong answer?
What is the mistake in this code?
https://www.codechef.com/viewsolution/37012722
CODE:-
#include
using namespace std;
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL);
int main() {
speed
int n,m;
cin>>n>>m;
int a[n][m];
for(int i=0;i<n;i++)
{
cin>>a[i][0];
int s=m;
while(s!=1)
{
s–;
a[i][s]=a[i][0]%10;
a[i][0]/=10;
}
}
int test;
cin>>test;
while(test–)
{
int x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
for(int i=x1-1;i<x2;i++)
{
for(int j=y1-1;j<y2;j++)
{
(a[i][j])? a[i][j]=0:a[i][j]=1;
}
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
cout<<a[i][j];
}
cout<<‘\n’;
}
return 0;
}