#include #include #include using namespace std; #define inf 0x3f3f3f3f struct node { int l; int p; }a[10005]; bool cmp(node b,node c) { return b.p=dp[top]+a[i].l?a[i].p:dp[top]+a[i].l); if(top+1>ans) ans=top+1; } printf("%d\n",ans); } return 0; }