Algorithm to improve Tata Apple 2 time limit: 1.0s memory limit: 256.0MBProblem description There is an apple tree in the yard of Tautau, and N apples will be produced in every fall tree. When Apple matures, Tata will run to pick apples. Tata had a 30-centimetre-high bench, and when she couldn't pick it up with her hand, she would step on the bench and try again.
The height of n apples to the ground is now known, and the maximum height that can be reached when the Tata handle is stretched. If she touches an apple, the Apple will fall. Please help Tata calculate, after her looting, there are still a few apples on the apple tree. Input format input includes two rows of data. The first line consists of only two positive integers n (5<=n<=200) and M (60<=m<=200), indicating the number of apples and the height (in centimeters) the peach can reach. The second line contains an integer (in centimeters) of n between 100 and 200 (including 100 and 200) that represents the height of the apple to the ground, separated by a space between two adjacent integers. Output format output includes one row, which contains only an integer that represents the number of apples that Tata cannot pick up. Sample Input 10 110
100 200 150 140 129 134 167 198 200 111 Sample Output 5
1#include <stdio.h>2 intMain () {3 intn,m;4scanf"%d%d",&n,&m);5 intFruit[n];6 inthigh=m+ -;7 intflag=N;8 for(intI=0; i<n;i++){9scanf"%d",&fruit[i]);Ten if(fruit[i]<=High ) { Oneflag--; A } - } -printf"%d", flag); the return 0; -}
C language · Tata Pick apples 2