提交时间:2024-03-30 15:05:51

运行 ID: 140406

#include<bits/stdc++.h> using namespace std; bool cmp(int x,int y){ return x>y; } int n; int dp[10010]; int a[10010],tmp[10010]; signed main(){ cin >> n; for(int i = 1;i <= n;i++){ cin >> a[i]; } for(int i = 1;i <= n;i++){ for(int j = i+1;j <= n;j++){ cout << dp[a[i]] << endl; cout << a[j] << endl; cout << a[i] << endl; if(dp[a[i]] > 0){ break; } if(a[j] >= a[i]){ dp[a[i]]++; } } } sort(a+1,a+n+1,cmp); sort(dp+1,dp+a[1]+1,cmp); cout << dp[1]; return 0; }