zoukankan      html  css  js  c++  java
  • 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
    
    ", i, sum);
        }
        return 0;
    }
  • 相关阅读:
    NumPy 字符串函数
    NumPy 位运算
    Numpy 数组操作
    最小二乘法的原理与计算
    NumPy 迭代数组
    Making AJAX Applications Crawlable
    mac, start sublime from terminal
    Speed Up Your WordPress Site
    To Support High-Density Retina Displays
    HTML5 tricks for mobile
  • 原文地址:https://www.cnblogs.com/RootVount/p/10365847.html
Copyright © 2011-2022 走看看