/* Name: Author: xiaruize Date: */ #include<bits/stdc++.h> usingnamespace std; #define int long long #define ull unsigned long long #define ALL(a) (a).begin(), (a).end() #define pb push_back #define mk make_pair #define pii pair<int, int> #define pis pair<int, string> #define sec second #define fir first #define sz(a) int((a).size()) #define rep(i, x, y) for (int i = x; i <= y; i++) #define repp(i, x, y) for (int i = x; i >= y; i--) #define Yes cout << "Yes" << endl #define YES cout << "YES" << endl #define No cout << "No" << endl #define NO cout << "NO" << endl #define debug(x) cerr << #x << ": " << x << endl #define double long double constint INF = 0x3f3f3f3f; constint MOD = 1000000007; constint N = 1e5 + 10;
// bool st; int t; int n, k; int a[N]; int pos[N]; // bool en;
voidsolve() { cin >> n >> k; for (int i = 1; i <= n; i++) { cin >> a[i]; pos[a[i]] = i; } int x = 1; int res = 0; for (int i = 1; i < n; i++) { if (pos[i + 1] > pos[i])//不需要操作 continue; //因为下一位在当前位前面,所以不得不进行操作 cout << (n - i + k - 1) / k << endl; return; } //递增 cout << "0" << endl; }