func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 3e5 + 7;   int n;   long long a[maxn];   long long work(long long m) {     long long res = 0;     while (m) {       if (m & 1) res++;       m >>= 1;     }     return res;   }   long long dp[maxn][2];   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       scanf( %lld , &a[i]);       a[i] = work(a[i]);     }     dp[0][0] = 0;     dp[0][1] = 0;     dp[1][0] = 0;     dp[1][1] = 0;     for (int i = 2; i <= n; ++i) {       if (a[i] & 1) {         dp[i][0] = dp[i - 1][1] + (a[i - 1] & 1);         dp[i][1] = dp[i - 1][0] + !(a[i - 1] & 1);       } else {         dp[i][0] = dp[i - 1][0] + !(a[i - 1] & 1);         dp[i][1] = dp[i - 1][1] + (a[i - 1] & 1);       }     }     long long ans = 0;     for (int i = 2; i <= n; ++i) {       int l_ = max(1, i - 119);       long long max_ = a[i], cnt = 0, sum = a[i];       for (int j = i - 1; j >= l_; --j) {         sum += a[j];         max_ = max(max_, a[j]);         if (sum & 1) continue;         if (max_ > sum / 2) cnt++;       }       ans += (dp[i][0] - cnt);     }     printf( %lld n , ans);     return 0;   }   