func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 100100;   const int INF = ~0U >> 1;   int N, idx[MAXN];   map<int, int> mp, o_cnt, ls;   map<int, vector<int> > rs;   int main() {     scanf( %d , &N);     int a;     for (int i = 1; i <= N; ++i) {       scanf( %d , &a);       mp[a] = i;     }     int o = INF;     for (int i = 1; i <= N; ++i) {       scanf( %d , &a);       a = idx[i] = mp[a];       if (i <= a) {         o_cnt[ls[i] = a - i] += 1;       } else {         rs[i - a].push_back(i);       }       o = min(o, abs(a - i));     }     printf( %d n , o);     for (int i = 1; i < N; ++i) {       if ((o_cnt[ls[i]] -= 1) == 0) {         o_cnt.erase(o_cnt.find(ls[i]));       }       ls.erase(ls.find(i));       rs[N + i - idx[i]].push_back(i);       if (rs.count(i)) {         for (vector<int>::iterator it = rs[i].begin(); it != rs[i].end(); ++it) {           o_cnt[ls[*it] = -i] += 1;         }         rs.erase(rs.find(i));       }       o = o_cnt.size() ? o_cnt.begin()->first + i : INF;       o = min(o, rs.size() ? rs.begin()->first - i : INF);       printf( %d n , o);     }     return 0;   }   