Optimizing performance of hashing array algorithm's implementation
The Good

The code is fairly readable, horizontal spacing is good.

The variables are declared as they are needed.

You didn't use using namespace std; which is very good for a beginner.

Macros in C++

Macros are included in C++ to support some backward compatibility with the C programming language that it grew out of, but they generally aren't used in C++ because they aren't type safe. Replacements for macros are inline functions, and lambda expressions or closures.

An alternate to what is in the code is to use typedef. A second alternative is to use using ll = long long;.

The best thing might be to find what types C++ supports and use that instead. You can find a list of the types provided by the cstdint header file here.

Another alternative is to just use long long rather than shortening it. C++ is not a scripting language and C++ coders are used to things like this.

Beginning a Variable or Function with Double Underscore.

Function names and variables should start with letters rather than underscores, double underscore is reserved for special usage.

Variable Names

Single letter variable names make the code very hard to understand, I don't even have a clue what c, q, l, r or v are or I would try to guess at their meanings.

Variables i and j are used as indexes into the vector, it would be better if these variables were of type size_t rather than long long because size_t is defined as unsigned and can't be negitive. It would very rare to have an array or vector that would require the address space of a long long.

One Variable Declaration Per Line

The code contains this line

        ll l, r, v;


To make the code more maintainable each variable should be declared and initialized on it's own line.

        ll l = 0;
        ll r = 0;
        ll v = 0;


Vertical Spacing

To make the code more readable it needs some vertical spacing, one line between logical blocks:

#include &lt;vector&gt;
#include &lt;iostream&gt;

using ll = long long;

ll __hash__(const std::vector&lt;int&gt; &amp;arr) {
    ll front = arr[0];
    for(ll i = 1; i &lt; arr.size(); i++){
        front = arr[i] - front;
    }
    return front;
}

int main() {
    std::vector&lt;int&gt; arr;

    ll size;
    std::cin &gt;&gt; size;
    for (ll i = 0; i &lt; size; ++i) {
        ll c;
        std::cin &gt;&gt; c;
        arr.push_back(c);
    }

    ll q;
    std::cin &gt;&gt; q;
    for (size_t i = 0; i &lt; q; ++i) {
        ll l, r, v;
        std::cin &gt;&gt; l &gt;&gt; r &gt;&gt; v;
        for(size_t j = l - 1; j &lt; r; ++j){
            arr[j] += v;
        }
        std::cout &lt;&lt; __hash__(arr) &lt;&lt; std::endl;
    }

    return 0;
}