Home > Back-end > Pick apples upgrade code correct.
Pick apples upgrade code correct.
Time:10-27
#include Int main () { Int n, s, a, b; The scanf (" % d % d ", & amp; N, & amp; s); The scanf (" \ n % d % d ", & amp; A, & amp; B); Int x [n], [n] y, num=0; for(int i=0; iThe scanf (" \ n % d % d ", & amp; [I], x & amp; Y [I]); for(int i=0; iIf (x [I] <=a + b& & S - [I] y & gt;=0) S=s - [I], y + + num. Printf (" % d ", num); return 0;
}
CodePudding user response:
Is it the problem you want to be a simple, or I think complex problems? Strength - 3, for example, the following apple needs to strength (level does not consider first) Apple 1 to 3 Apple's strength 2 Apple is 3 to 1 Apple 4 to 1 Apple 5 strength 1 According to your logic, most can only pick one apple (apple), energy is used up, but I think I should pick three apple apple (apple 3, 4, 5) is the maximum number of an apple,
CodePudding user response:
The original problem is some ceramic picking apples, baidu has