提交时间:2023-04-13 13:58:09
运行 ID: 74502
#include<bits/stdc++.h> #define int long long using namespace std; struct member{ int strong; int beauty; }; bool cmp(member a,member b){ return a.strong<a.strong; } member a[100001]; int dp[100001]; signed main(){ int n,i,j; cin>>n; for(i=1;i<=n;i++){ cin>>a[i].strong>>a[i].beauty; } sort(a+1,a+n+1,cmp); int maxs=0; for(i=1;i<=n;i++) { /* TODO (jntm#9#): fire engine */ dp[i]=1; for(j=1;j<i;j++) { if((a[j].beauty>a[i].beauty)) { dp[i]=max(dp[i],dp[j]+1);/* Name: Copyright: Author: Date: 13/04/23 13:57 Description: */ } /* TODO (114514#1#): fuck you */ } maxs=max(maxs,dp[i]); } cout<<maxs; return 0; }