func_code_string: #include <bits/stdc++.h>   using namespace std;   struct p {     int s, n;   };   int comp(struct p a, struct p b) { return (a.s <= b.s); }   int main() {     vector<long long> a, sb, s, r;     long long i, j, k, n, ss, sss, rrr;     cin >> n;     s.resize(n + 2, 0);     r.resize(n + 2, 0);     sb.push_back(0);     for (i = 1; i <= n; i++) {       cin >> k;       a.push_back(k);       sb.push_back(sb.back() + k);     }     ss = sb.back();     if (ss % 3 != 0 || n <= 2) {       cout <<  0  << endl;       return 0;     }     sss = 0;     rrr = 0;     for (i = 0; i < n; i++) {       if (sss == ss / 3 && i != 0) s[i]++;       if (rrr == ss / 3 && i != 0) r[i]++;       sss += a[i];       rrr += a[n - i - 1];       s[i + 1] = s[i];       r[i + 1] = r[i];     }     long long c = s[0], var = 0;     for (i = 1; i < n; i++) {       if (s[i] != c) {         c = s[i];         var += r[n - i - 1];       }     }     cout << var << endl;   }   