SDNU 1275.我的滑板鞋

Description

TT最近迷上了收集各种滑板鞋,但他有个癖好:只收集尺码大于x的滑板鞋(x是大于0的整数)。请你帮他找出可以收集多少滑板鞋。

Input

第一行一个正整数N。接下来的N行每行第一个数M表示他要在M双滑板鞋里挑,第二个数x表示他要找出尺码大于x的滑板鞋,后边是M个数,分别是每双滑板鞋的尺码。

Output

输出N个情况下TT能收集多少双滑板鞋,每种情况之间有一个空行。

Sample Input

5
2 23 24 21
3 35 32 21 33
5 14 16 30 6 15 19
1 10 11
2 40 41 40 

Sample Output

Case 1:1

Case 2:0

Case 3:4

Case 4:1

Case 5:1
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>

using namespace std;

#define ll long long

int shoes[1000+8];
int main()
{
    int n, m, x, sum;
    scanf("%d", &n);
    for(int i = 1; i <= n; i++)
    {
        scanf("%d%d", &m, &x);
        sum = 0;
        for(int j = 1; j <= m; j++)
        {
            scanf("%d", &shoes[j]);
            if(shoes[j]>x) sum++;
        }
        printf("Case %d:%d\n\n", i, sum);
    }
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/RootVount/p/10365847.html