???

P1478 陶陶摘苹果(升级版)

yuguoyu @ 2021-11-23 10:12:38

#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<queue>
#define ll long long
#define MAXN 1000100
using namespace std;
int main()
{
    long long a[5100],x,w,v,n,t,s[5100];
    cin>>v>>n;
    cin>>t>>x;
    for(int i=0;i<v;i++)
         cin>>a[i]>>s[i];
    sort(s,s+v);
    for(int i=0;i<v;i++)
    {
        if((x>=a[i]&&n>=s[i])||(x+t>=a[i]&&n>=s[i])) 
        {
            n-=s[i];
            w++;
        }
    }
    cout<<w;
}

by Ckger @ 2021-11-23 11:47:13

你想表达什么?


by _gcl @ 2021-11-23 12:10:25

你想表达什么?


by Engulf @ 2021-11-23 12:19:25

你想表达什么?


by lym12321 @ 2021-11-23 12:23:17

你想表达什么?


by _wzcxx @ 2021-11-23 15:52:22

你想表达什么?


by Konnyaku_q @ 2021-11-23 15:58:08

你想表达什么?


by Konnyaku_k @ 2021-11-23 15:58:16

你想表达什么?


by yuguoyu @ 2021-11-23 16:53:06

我的最后一个测试评点错了,应该怎么改?


by _wzcxx @ 2021-11-23 17:34:55

@zhanan


|