func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   int n, m, q, i, s, j, k, u, dis[N][350], lazy[350], W[N];   long long sum[N], arr[N], x, Y[350];   char c;   vector<int> G[N], F[N];   bool H[N], is[N][350];   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n >> m >> q;     for (i = 1; i <= n; i++) cin >> arr[i];     for (i = 1; i <= m; i++) {       cin >> s;       G[i].resize(s);       if (s >= 350) H[i] = 1, u++, W[i] = u - 1;       for (j = 0; j < s; j++) {         cin >> G[i][j];         if (H[i]) is[G[i][j]][u - 1] = 1, sum[u - 1] += arr[G[i][j]];       }     }     for (i = 1; i <= m; i++) {       for (int j : G[i]) {         for (int k = 0; k <= 340; k++)           if (is[j][k]) dis[i][k]++;       }     }     while (q--) {       cin >> c >> k;       if (c ==  ? ) {         if (H[k] == 0) {           long long r = 0;           for (int j : G[k]) r += 1ll * arr[j];           for (i = 0; i < 340; i++) r += Y[i] * dis[k][i];           cout << r <<   n ;         } else           cout << sum[W[k]] <<   n ;       } else {         cin >> x;         if (!H[k]) {           for (int j : G[k]) arr[j] += x;           for (i = 0; i < 340; i++) sum[i] += x * dis[k][i];         } else {           for (i = 0; i < 340; i++) sum[i] += 1ll * x * dis[k][i];           Y[W[k]] += x;         }       }     }   }   