博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Round #160 (Div. 2)---A. Roma and Lucky Numbers
阅读量:5837 次
发布时间:2019-06-18

本文共 1597 字,大约阅读时间需要 5 分钟。

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Roma (a popular Russian name that means 'Roman') loves the Little Lvov Elephant's lucky numbers.

Let us remind you that lucky numbers are positive integers whose decimal representation only contains lucky digits 4 and 7. For example, numbers 477444 are lucky and 517467 are not.

Roma's got n positive integers. He wonders, how many of those integers have not more than k lucky digits? Help him, write the program that solves the problem.

Input

The first line contains two integers nk (1 ≤ n, k ≤ 100). The second line contains n integers ai (1 ≤ ai ≤ 109) — the numbers that Roma has.

The numbers in the lines are separated by single spaces.

Output

In a single line print a single integer — the answer to the problem.

Sample test(s)
input
3 41 2 4
output
3
input
3 2447 44 77
output
2
Note

In the first sample all numbers contain at most four lucky digits, so the answer is 3.

In the second sample number 447 doesn't fit in, as it contains more than two lucky digits. All other numbers are fine, so the answer is 2.

题目大意:脑残呀,開始居然没读懂题意。给出n个数,让你看这么多数中,有多少个是包括不多于k个幸运数字的,当中4和7是幸运数字。

解题思路:直接推断每一个数数否满足情况就好了。

AC代码:

#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;#define INF 0x7fffffffint main(){ #ifdef sxk freopen("in.txt","r",stdin); #endif int n, k, t; while(scanf("%d%d",&n,&k)!=EOF) { int ans = 0; for(int i=0; i

转载地址:http://qgccx.baihongyu.com/

你可能感兴趣的文章
让你的WPF程序在Win7下呈现Win8风格主题
查看>>
802.11 学习笔记
查看>>
Leetcode-Database-176-Second Highest Salary-Easy(转)
查看>>
构建Docker Compose服务堆栈
查看>>
Hadoop生态圈-Kafka常用命令总结
查看>>
如何基于Redis Replication设计并实现Redis-replicator?
查看>>
浮点数内存如何存储的
查看>>
EventSystem
查看>>
用WINSOCK API实现同步非阻塞方式的网络通讯
查看>>
玩一玩博客,嘿嘿
查看>>
Ubuntu设置python3为默认版本
查看>>
JsonCpp 的使用
查看>>
问题账户需求分析
查看>>
32、SpringBoot-整合Dubbo
查看>>
HDU 2044 一只小蜜蜂(递归)
查看>>
spring两大核心对象IOC和AOP(新手理解)
查看>>
hp 服务器通过串口重定向功能的使用
查看>>
MongoDB CookBook读书笔记之导入导出
查看>>
shell如何快速锁定所有账号
查看>>
HTML 5实现的手机摇一摇
查看>>