Codeforces Round #213 (Div. 2) A. Good Number
#include <iostream>
#include <vector> using namespace std;
int main(){
int n,k,cnt = ;
cin >> n >>k;
for( int i = ; i < n ; ++ i ){
int a;
vector<int> goodNum(k+,);
cin >> a;
while(a){
if(a%<=k) goodNum[a%]++;
a/=;
}
int j = ;
for(j = ; j < k+; ++ j)
if(!goodNum[j]) break;
if(j >= k +) cnt++;
}
cout<<cnt<<endl;
return ;
}
Codeforces Round #213 (Div. 2) A. Good Number的更多相关文章
- Codeforces Round #427 (Div. 2) B. The number on the board
引子: A题过于简单导致不敢提交,拖拖拉拉10多分钟还是决定交,太冲动交错了CE一发,我就知道又要错过一次涨分的机会.... B题还是过了,根据题意目测数组大小开1e5,居然蒙对,感觉用vector更 ...
- Codeforces Round #585 (Div. 2) B. The Number of Products(DP)
链接: https://codeforces.com/contest/1215/problem/B 题意: You are given a sequence a1,a2,-,an consisting ...
- Codeforces Round #411 div 2 D. Minimum number of steps
D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input st ...
- Codeforces Round #491 (Div. 2) E - Bus Number + 反思
E - Bus Number 最近感觉打CF各种车祸.....感觉要反思一下, 上次读错题,这次想当然地以为18!肯定暴了longlong 而没有去实践, 这个题我看到就感觉是枚举每个数字的个数,但是 ...
- Codeforces Round #460 (Div. 2)-B. Perfect Number
B. Perfect Number time limit per test2 seconds memory limit per test256 megabytes Problem Descriptio ...
- Codeforces Round #209 (Div. 2) C - Prime Number
传送门 题意 给出n个数及x,求 \[\frac{\sum _{i=1}^n x^{a_1+a_2+...+a_{i-1}+a_{i+1}+...a_n}}{\prod_{i=1}^n x^{a_i} ...
- Codeforces Round #608 (Div. 2) E. Common Number
链接: https://codeforces.com/contest/1271/problem/E 题意: At first, let's define function f(x) as follow ...
- Codeforces Round #460 (Div. 2) B Perfect Number(二分+数位dp)
题目传送门 B. Perfect Number time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- Codeforces Round #555 (Div. 3) B. Long Number 【仔细读题】
B. Long Number time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...
随机推荐
- 见招拆招:绕过WAF继续SQL注入常用方法
Web Hacker总是生存在与WAF的不断抗争之中的,厂商不断过滤,Hacker不断绕过.WAF bypass是一个永恒的话题,不少基友也总结了很多奇技怪招.那今天我在这里做个小小的扫盲吧.先来说说 ...
- HDU 1710 二叉树的遍历 Binary Tree Traversals
Binary Tree Traversals Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/O ...
- twisted udp编程
概述 Unlike TCP, UDP has no notion of connections. A UDP socket can receive datagrams from any server ...
- 用sed删除空行
用sed删除空行 我的代码如下:class Song def initialize(name) @name = name end def tell puts @nam ...
- MySQL 如何只导出 指定的表 的表结构和数据 ( 转 )
MySQL 如何只导出 指定的表 的表结构和数据 ( 转 ) 2011-01-04 15:03:33 分类: MySQL MySQL 如何只导出 指定的表 的表结构和数据 导出更个库的表结构如下:my ...
- mysql lower,upper实现大小写
mysql的lower和uppper函数可以将指定字符串转换为小写和大写 select lower('OutSpringTd') as lowerCase, upper('OutSpringTd') ...
- (转)Sql Server 对锁的初步认识
一:到底都有哪些锁 学习锁之前,必须要知道锁大概有几种???通常情况下作为码农我们只需知道如下几个锁即可... 1.S(Share)锁 为了方便理解,我们可以直接这么认为,当在select的时候在表, ...
- Java如何读取XML文件 具体实现
转载自:http://www.jb51.net/article/44338.htm import java.io.*; import javax.xml.parsers.DocumentBuilder ...
- 【python】a[::-1]翻转
设有一个元组或者列表 a = (1,2,3,4) b = [1,2,3,4] 则a[::-1]和b[::-1]的含义是将元组或列表的内容翻转 a[::-1] # 结果为(4,3,2,1) b[::-1 ...
- Power Strings(poj 2406)
题意:求字符串中循环节出现的次数 KMP!!! #include<cstdio> #include<iostream> #include<cstring> #def ...