题目链接:http://codeforces.com/problemset/problem/1167/A

思路:检索前面0 ~(n −11)个字符中是否有 8 即可。

AC代码:

 #include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n;
string a;
bool flag = false;
cin >> n >> a;
for(int i = ;i <= n - ;i++)
{
if(a[i] == '') flag = true;
}
if(flag && a.size() >= ) cout << "YES" << endl;
else cout << "NO" << endl;
}
return ;
}

Codeforces 1167A-Telephone Number的更多相关文章

  1. Educational Codeforces Round 65 (Rated for Div. 2) A. Telephone Number

    链接:https://codeforces.com/contest/1167/problem/A 题意: A telephone number is a sequence of exactly 11  ...

  2. Codeforces 55D Beautiful Number

    Codeforces 55D Beautiful Number a positive integer number is beautiful if and only if it is divisibl ...

  3. Codeforces 40 E. Number Table

    题目链接:http://codeforces.com/problemset/problem/40/E 妙啊... 因为已经确定的格子数目严格小于了$max(n,m)$,所以至少有一行或者一列是空着的, ...

  4. Codeforces 124A - The number of positions

    题目链接:http://codeforces.com/problemset/problem/124/A Petr stands in line of n people, but he doesn't ...

  5. codeforces Soldier and Number Game(dp+素数筛选)

    D. Soldier and Number Game time limit per test3 seconds memory limit per test256 megabytes inputstan ...

  6. Codeforces 55D Beautiful Number (数位统计)

    把数位dp写成记忆化搜索的形式,方法很赞,代码量少了很多. 下面为转载内容:  a positive integer number is beautiful if and only if it is  ...

  7. Codeforces 980E The Number Games 贪心 倍增表

    原文链接https://www.cnblogs.com/zhouzhendong/p/9074226.html 题目传送门 - Codeforces 980E 题意 $\rm Codeforces$ ...

  8. Codeforces 980E The Number Games - 贪心 - 树状数组

    题目传送门 传送点I 传送点II 传送点III 题目大意 给定一颗有$n$个点的树,$i$号点的权值是$2^{i}$要求删去$k$个点,使得剩下的点仍然连通,并且总权值和最大,问删去的所有点的编号. ...

  9. [CodeForces - 919B] Perfect Number

    题目链接:http://codeforces.com/problemset/problem/919/B AC代码: #include<cstdio> using namespace std ...

  10. Codeforces 995 E - Number Clicker

    E - Number Clicker 思路:双向搜索 代码: #include<bits/stdc++.h> using namespace std; #define fi first # ...

随机推荐

  1. 二维差分前缀和——cf1202D(好题)

    直接枚举每个点作为左上角是可以做的,但是写起来较麻烦 有一种较为简单的做法是对一列或一行统计贡献 比如某一行的B存在的区间是L,R那么就有三种情况 1.没有这样的区间,即一行都是W,此时这行对答案的贡 ...

  2. AcWing 199. 余数之和 (除法分块)打卡

    给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值. 例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod ...

  3. Spring源码剖析2:初探Spring IOC核心流程

    本文转载自互联网,侵删 本系列文章将整理到我在GitHub上的<Java面试指南>仓库,更多精彩内容请到我的仓库里查看 https://github.com/h2pl/Java-Tutor ...

  4. Ubuntu下qemu环境搭建vexpress开发平台

    在查找资料过程中,发现自己搭建虚拟的arm环境的话,有一个比较好的软件就是qemu了,当然还有其他的,大家各投所好就好. 接下来说一下qemu环境搭建过程. 其实搭建很简单,作为小白,我还是捣鼓了两三 ...

  5. 带头节点的单链表-------C语言实现

    /***************************************************** Author:Simon_Kly Version:0.1 Date:20170520 De ...

  6. arttemplate02

    1.后台传来的数据 { "code": 200, "checkRecords": [ { "id": "402881e75cc80 ...

  7. std::locale与boost::locale的学习

    1. 什么是facet, locale facet ['fæsɪt]的原意,是宝石切割出来的一个平面. locale[ləʊˈkæl],表示本地化, locale the container that ...

  8. Bochs调试VirtualBox生成的VDI映像

    将VDI映像转换成Bochs支持的img映像 1: vboxmanage clonehd source.vdi destination.img --format RAW 在bochsrc.txt中引用 ...

  9. npm和cnpm的安装(window)

    一:安装node.js 1.进入https://nodejs.org/en/中下载自己电脑相对应的node.js. 2.将下载下来的node.js进行安装. 3.利用管理员身份打开cmd,在里面输入n ...

  10. 常用css3属性的ie兼容查看

    记录一下关于css3的各种常用属性对ie各版本浏览器的兼容程度: 最低可兼容ie7 最低可兼容ie8 最低可兼容ie9 最低可兼容ie10 position:fixed clip E:first-le ...