#include <stdio.h>
#include <string.h>
bool vis[11];
int n, k;
bool judge(int x)
{
memset(vis, false, sizeof(vis));
if (x == 0)
vis[0] = true;
while (x)
{
vis[x%10] = true;
x /= 10;
}
for (int i = 0; i <= k; i++)
if (vis[i] == false)
return false;
return true;
}
int main()
{
int x;
while (scanf("%d %d", &n, &k) != EOF)
{
int ans = 0;
for (int i = 1; i <= n; i++)
{
scanf("%d", &x);
if (judge(x))
ans++;
}
printf("%d\n", ans);
}
return 0;
}

B,求序列中最长满足斐波那契性质的序列长度。

#include <stdio.h>

int a[100005];

int main()
{
int n;
while (scanf("%d", &n) != EOF)
{
int ans = 0;
int len = 0;
for (int i = 1; i <= n; i++)
{
scanf("%d", &a[i]);
if (i > 2)
{
if (a[i] == a[i-1] + a[i-2])
{
len++;
if (len > ans)
ans = len;
}
else
{
len = 0;
}
}
}
if (n < 2)
printf("%d\n", n);
else
printf("%d\n", ans+2);
}
return 0;
}

codeforces 213div(2) 365 A.Good Number 365 B.The Fibonacci Segment的更多相关文章

  1. Codeforces Beta Round #51 B. Smallest number dfs

    B. Smallest number Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/pro ...

  2. Office 365系列(三) -Office 365 Pro plus 安装

    这一篇博客主要是说Office 365 Pro plus安装. 1. 当登陆到Office 365以后,点击右边链接“下载软件” 2. 安装最新Office 软件 3. 采用点对点安装,当安装成功以后 ...

  3. Codeforces 617 E. XOR and Favorite Number

    题目链接:http://codeforces.com/problemset/problem/617/E 一看这种区间查询的题目,考虑一下莫队. 如何${O(1)}$的修改和查询呢? 令${f(i,j) ...

  4. codeforces 617E E. XOR and Favorite Number(莫队算法)

    题目链接: E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes i ...

  5. Codeforces Round #266 (Div. 2) C. Number of Ways

    You've got array a[1], a[2], ..., a[n], consisting of n integers. Count the number of ways to split ...

  6. 【第400篇题解纪念2016年10月28日】【28.10%】【codeforces 617E】XOR and Favorite Number

    time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  7. Codeforces 617E:XOR and Favorite Number(莫队算法)

    http://codeforces.com/problemset/problem/617/E 题意:给出n个数,q个询问区间,问这个区间里面有多少个区间[i,j]可以使得ai^ai+1^...^aj ...

  8. codeforces 617 E. XOR and Favorite Number(莫队算法)

    题目链接:http://codeforces.com/problemset/problem/617/E 题目: 给你a1 a2 a3 ··· an 个数,m次询问:在[L, R] 里面又多少中 [l, ...

  9. Codeforces Round #651 (Div. 2) C. Number Game(数论)

    题目链接:https://codeforces.com/contest/1370/problem/C 题意 给出一个正整数 $n$,Ashishgup 和 FastestFinger 依次选择执行以下 ...

随机推荐

  1. 【JAVA NIO】java NIO

    本文是博主深入学习Netty前的一些铺垫,之前只是使用Netty,用的很粗暴,导包,上网找个DEMO就直接用,对Netty中的组件了解并不深入. 于是再此总结下基础,并对一些核心组件作如下记录: 1. ...

  2. 【JVM】02垃圾回收机制

    垃圾回收 垃圾回收策略https://blog.csdn.net/u010425776/article/details/51189318 程序计数器.Java虚拟机栈.本地方法栈都是线程私有的,也就是 ...

  3. Windows上安装PyV8

    Windows上安装PyV8 在PyPi网站上有Windows的exe格式的包连接, PyPi, Google注意网络是否通畅! 官网地址 Google PyV8 双击安装, 注意, 一般会自动检测P ...

  4. Java Volatile 关键字详解

    原文链接:https://www.cnblogs.com/zhengbin/p/5654805.html 一.基本概念 先补充一下概念:Java 内存模型中的可见性.原子性和有序性. 可见性: 可见性 ...

  5. 常用的方法论-NPS

  6. asp.net core系列 67 Web压力测试工具WCAT

    一.介绍 最近搭建了一套CQRS框架,需要在投入开发前,进行必要的压力测试.Web Capacity Analysis Tool  (Wcat)是一种轻量级HTTP负载生成工具,主要用于衡量受控环境中 ...

  7. 关于ffmpeg /iis 8.5 服务器下,视频截取第一帧参数配置

    ffmpeg 视频截取第一帧参数配置: 网站找了很多资料,但是都不能满足要求,然后自己写下解决过程. 首先看自己PHP 版本,安全选项里面 php5.4  跟php5.6 是不一样的.去除里面的sys ...

  8. div+css 布局技巧总计

    一.css 样式 1.float 首先需要了解块级元素(block element).每个块级元素都默认占用一行,在同一行只能添加一个块元素(float 除外).块级元素一般可以嵌套块级元素或者行内元 ...

  9. Oracle数据库---异常处理

    Oracle异常处理在PL/SQL语句书写时,需要处理的异常-- 不做异常处理时DECLARE v_name emp.ename%TYPE; v_sal emp.sal%TYPE;BEGIN SELE ...

  10. 基于SpringCloud的Microservices架构实战案例-在线API管理

    simplemall项目前几篇回顾: 1基于SpringCloud的Microservices架构实战案例-序篇 2基于SpringCloud的Microservices架构实战案例-架构拆解 3基于 ...