Problem Descriptionsoapbear is the mascot of WHUACM team. Like the other bears, Soapbear loves honey very much, so he decides-get some honeycombs for honey. There was N honeycombs hanging on some trees, numbered from 1 to N, and the height of honeycomb I was Hi. The height soapbear can reach the is Hx, so he wonders how many honeycombs he can get in most. Inputthere is multiple test cases in the input file. There first line of the input was an integer T indicates the number of the the test cases. Each test case is starts with a line containing the integer, N and HX (0 < n <= 200000, 0 < HX < 200). Next, there is a line of n integers specifying hi (1 <= i <= N, 0 < Hi < 200). Outputfor each test case, output a line with an integer indicates the number of honeycombs soapbear can get in most. Sample Input
22 180170 1903 180180 170 190
Sample Output
12
HINT
Note:input/output of scanf/printf is faster than cin/cout, so if a problem have huge Input data, use CIN would probably get A time Limit exceeded.
1#include <stdio.h>2 #defineN 2000013 intMain ()4 {5 intn,m,hx=0;6 intA[n];7scanf"%d",&n);8 while(n--)9 {Ten intresult=0; One for(intI=0; i<n;i++) Aa[i]=0; -scanf"%d",&m); -scanf"%d",&Hx); the for(intj=0; j<m;j++) - { -scanf"%d",&a[j]); - } + for(intk=0; k<m;k++) - { + if(a[k]<=Hx) Aresult++; at } -printf"%d\n", result); - } - return 1; -}
Wuhan University of Science and Technology Acm:1005:soapbear and Honey