func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<long long> vec;   int main(void) {     long long n1, n2, i, j, k, n, d;     cin >> n >> d;     for (i = 0; i < n; i++) vec.push_back(i + 1);     long long Min, Max = 0, sum;     do {       sum = 0;       for (i = 0; i < n; i++) {         for (j = i; j < n; j++) {           Min = vec[i];           for (k = i; k <= j; k++) Min = min(vec[k], Min);           sum += Min;         }       }       Max = max(Max, sum);     } while (std::next_permutation(vec.begin(), vec.end()));     long long count = 0;     sort(vec.begin(), vec.end());     do {       sum = 0;       for (i = 0; i < n; i++) {         for (j = i; j < n; j++) {           Min = vec[i];           for (k = i; k <= j; k++) Min = min(vec[k], Min);           sum += Min;         }       }       if (sum == Max) {         count++;         if (count == d) break;       }     } while (std::next_permutation(vec.begin(), vec.end()));     for (i = 0; i < n; i++) cout << vec[i] <<    ;   }   