P1060 [NOIP2006 普及组] 开心的金明
const LL N=1e5+86;
int main()
{
//IN;OUT;
ios::sync_with_stdio(false);
cin.tie(0);
LL n,m,v,p,dp[N];
cin>>n>>m;
f(i,1,m){
cin>>v>>p;
for(int j=n;j>=v;j--){
dp[j]=max(dp[j],dp[j
more...