• + 0 comments
        I think You can make a small improvement.
        It was possible to create an array with n + 2 elements instead of n-1 elements and not use the operator "if".
    
        change 
    
        1. "long int *a=new long int[N+1]();" to 
        "long int *a=new long int[N+2]();"
        2. "if((q+1)<=N) a[q+1]-=sum;" to 
                              "a[q+1]-=sum;"