Xorry Queries

  • + 0 comments

    what is wrong with this??

    include

    using namespace std; int main() { int n,i,m,l,k,j,p,x,sum=0; cin>>n>>m>>p; int a[n];

    for(i=1;i<=n;i++) { cin>>a[i]; } for(i=1;i<=m;i++) { cin>>j>>k>>l; if(j==1) { a[k]=a[k]^l;

     }
     if(j==2)
     {
        for(x=k;x<=l;x++)
        {
    
            if(x+p-2<n)
            {
    
                a[x]=a[x]^a[x+1];
                sum+=a[x];
            }
            else
                a[x]=0;
        }
     }
    

    }

    cout<

    }