自家测得是对的,而落谷上则只有20分!!蒟蒻求助
#include <iostream>
using namespace std;
int main()
{
int value_apple_sum;
int value_strength_sum;
int value_stool_height;
int value_body_height;
int ans = 0;
cin >> value_apple_sum >> value_strength_sum >> value_stool_height >> value_body_height;
int* value_apple_high = new int[value_apple_sum];
int* value_need_strength = new int[value_apple_sum];
for (int i = 0; i < value_apple_sum; i++)
{
cin >> value_apple_high[i] >> value_need_strength[i];
if (value_body_height + value_stool_height >= value_apple_high[i] && value_strength_sum - value_need_strength[i] >= 0)
{
ans++;
value_strength_sum -= value_need_strength[i];
}
}
cout << ans;
return 0;
}