func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   vector<vector<long long>> g;   vector<long long> a;   vector<long long> ans;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long n;     cin >> n;     g = vector<vector<long long>>(n + 1);     a = vector<long long>(n + 1);     ans = vector<long long>(n + 1, LLONG_MAX);     for (int i = 1; i <= n; i++) {       cin >> a[i];       if (i - a[i] >= 1) {         g[i - a[i]].push_back(i);       }       if (i + a[i] <= n) {         g[i + a[i]].push_back(i);       }     }     set<long long> toUp;     for (int i = 1; i <= n; i++) {       for (auto x : g[i]) {         if (a[x] % 2 != a[i] % 2) {           ans[x] = 1;           toUp.insert(x);         }       }     }     while (!toUp.empty()) {       vector<long long> temp(toUp.begin(), toUp.end());       toUp.clear();       for (auto i : temp) {         for (auto x : g[i]) {           if (ans[x] > ans[i] + 1) {             ans[x] = ans[i] + 1;             toUp.insert(x);           }         }       }     }     for (int i = 1; i <= n; i++) {       if (ans[i] == LLONG_MAX)         cout <<  -1  ;       else         cout << ans[i] <<    ;     }     return 0;   }   