• April Fools Day Contest 2016 G. You're a Professional


    G. You're a Professional

    题目连接:

    http://www.codeforces.com/contest/656/problem/G

    Description

    A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.

    You are given user's friends' opinions about a list of items. You are also given a threshold T — the minimal number of "likes" necessary for an item to be recommended to the user.

    Output the number of items in the list liked by at least T of user's friends.

    Input

    The first line of the input will contain three space-separated integers: the number of friends F (1 ≤ F ≤ 10), the number of items I (1 ≤ I ≤ 10) and the threshold T (1 ≤ T ≤ F).

    The following F lines of input contain user's friends' opinions. j-th character of i-th line is 'Y' if i-th friend likes j-th item, and 'N' otherwise.

    Output

    Output an integer — the number of items liked by at least T of user's friends.

    Sample Input

    3 3 2
    YYY
    NNN
    YNY

    Sample Output

    2

    Hint

    题意

    有m个人,有n个人给他Y或者N,如果大于等于T个人的话,这个人就很厉害。

    问你有多少个人很厉害。

    题解:

    水题,但是特别迷……

    你第一发肯定是wa的,然后第二发得和第一发的语言不一样

    交上去之后发现代码长度过长了,然后缩代码

    然后发现要加一个kitten

    然后就ac了

    代码

    f,I,T=map(int,input().split())
    s=[];
    for i in range(f):
        s.append(input())
    print(sum(sum((s[i][j] == 'Y' for i in range(f)))>=T for j in range(I)))
    #kitten
  • 相关阅读:
    群发邮件2
    谈谈C#中的三个关键词new , virtual , override
    一个简单的jQuery插件ajaxfileupload实现ajax上传文件例子
    网站静态化结构
    第四十七章 天神的邀请
    asp.net 异步群发邮件时遭遇到的问题 ddddddddd
    第四十章 远方的消息
    商用群发p2p网络
    第四十八章 三大客卿
    第四十五章 你没让我失望
  • 原文地址:https://www.cnblogs.com/qscqesze/p/5348241.html
Copyright © 2020-2023  润新知