Analysis : Sort from largest to smallest, find the first number of days whose mileage is less than or equal to i, that is, the i-th day is the answer (I didn’t understand what it means when I read the question, rubbish question ┭┮﹏┭┮, hateful)
#include<iostream>#include<cstring>#include<vector>#include<map>#include<stdio.h>#include<math.h>#include<algorithm>
using namespace std;#define MAX 999999999int n,m;intmain(){
cin>>n;int a[n+1];for(int i =0; i < n ; i++)
cin>>a[i];sort(a,a+n,greater<int>());int i;for(i =0; i < n ;i++)if(a[i]<= i +1)break;
cout<<i;return0;}