func_code_string: #include <bits/stdc++.h>   long long p[1000010] = {0}, cur[1000010 * 2] = {0};   inline long long read() {     char c;     while (!isdigit(c)) c = getchar();     long long x = 0;     while (isdigit(c)) {       x = x * 10 + c -  0 ;       c = getchar();     }     return x;   }   int main() {     long long sum, ans, L, R, k, n;     scanf( %lld , &n);     sum = L = R = k = 0;     for (int i = 1; i <= n; i++) {       p[i] = read();       sum += abs(p[i] - i);       if (p[i] >= i) {         L++;         cur[p[i] - i]++;       } else         R++;     }     ans = sum;     for (int i = 0; i < n - 1; i++) {       L -= cur[i];       R += cur[i];       sum = sum - L + R - abs(p[n - i] - n - 1) + p[n - i] - 1;       cur[p[n - i] + i]++;       L++;       R--;       if (sum < ans) {         ans = sum;         k = i + 1;       }     }     printf( %lld %lld n , ans, k);     return 0;   }   