提交时间:2023-11-09 14:02:28
运行 ID: 109540
#include<bits/stdc++.h> using namespace std; int bin(long long low,long long high) { if(low>high) return -1; else { middle=(low+high)/2; if(x==a[middle]) return middle+1; else if(x<a[middle]) { high=middle-1; bin(low,high); } else if(x>a[middle]) { low=middle+1; bin(low,high); } } } int main() { cin>>l>>n>>k; for(int i=1;i<=n;i++) { cin>>a[i]; d[i-1]=a[i]-a[i-1]; } sort(d+1,d+n); cout<<d[k+1]; }