站外题求助
查看原帖
站外题求助
746229
Joker_lazydoghead楼主2023/1/29 11:34

代码:

/*
User_Name:Lazy_doghead
Apdate:2023-1-29
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long Barbatoss;
typedef long long Wendy;
typedef long ShaTang;
typedef int LeiZe;
Wendy n,a[100001],b[100001],i,j,cnt,tot;
Barbatoss dfs(Wendy h){
	Wendy hj,t=1,bx;
	for(hj=h+1;hj<=n;hj++)if(a[hj]>b[h])t++,dfs(hj);
	bx=max(bx,t);
	t=1;
	return bx;
}
main(){
	scanf("%lld",&n);
	for(i=1;i<=n;i++)scanf("%lld%lld",&a[i],&b[i]);
	cnt=dfs(1);
	printf("%lld",cnt);
}
/*
3
1 4
3 6
5 7
*/
2023/1/29 11:34
加载中...