func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MOD = 1000 * 1000 * 1000 + 7;   const int INF = 2000 * 1000 * 1000;   const double EPS = 1e-9;   const double pi = acos(-1.0);   const int maxn = 1010;   const int maxsum = 10010;   template <typename T>   inline T sqr(T n) {     return (n * n);   }   int n, a[maxn], mem[maxn][2 * maxsum];   int* dp[maxn];   long long ans;   int main() {     scanf( %d , &n);     dp[0] = mem[0] + maxsum;     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       dp[i] = mem[i] + maxsum;     }     dp[0][0] = 1;     ans = 0;     for (int i = 1; i <= n; i++) {       for (int sum = -10000; sum <= 10000; sum++) {         if (sum + a[i] <= 10000) dp[i][sum] += dp[i - 1][sum + a[i]];         if (sum - a[i] >= -10000) dp[i][sum] += dp[i - 1][sum - a[i]];         dp[i][sum] %= MOD;       }       ans += dp[i][0];       ans %= MOD;       dp[i][0]++;     }     printf( %I64d , ans);     return 0;   }   