题目链接: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. Delphi实现提取可执行文件内部所有图标

    本实例实现的功能是能够从用户选择的可执行文件(后缀名为exe)中提取所有图标并且显示在窗体上. 在窗体中添加TImage 组件.TOpenDialog组件和TButton组件,TImage组件充当显示 ...

  2. word文档操作

    1.如何把word文档修改的地方标记出来   :  https://zhidao.baidu.com/question/73648149.html 2.word 的几种 视图:https://zhid ...

  3. flutter 使用keyboard_actions 关闭ios键盘

    项目中登录 输入账号密码 弹出的键盘 关闭不了,从而 引来一些问题, 1,第一次关闭 项目是在 最外层包裹一层,点击的时候进行关闭, return Scaffold( resizeToAvoidBot ...

  4. 如何扫描统计全国Telnet默认口令

    如何扫描统计全国Telnet默认口令 zrools2016-01-21共339474人围观 ,发现 23 个不明物体系统安全终端安全 本文原创作者:zrools 本文中介绍的工具.技术带有一定的攻击性 ...

  5. Linux/UNIX上安装Mysql

    接下来我们在 Centos 系统下使用 yum 命令安装 MySql: 检测系统是否自带安装 mysql: rpm -qa | grep mysql 如果你系统有安装,那可以选择进行卸载: rpm - ...

  6. JavaFX开发环境安装配置

    JavaFX开发环境安装配置 从Java8开始,JDK(Java开发工具包)包括了JavaFX库. 因此,要运行JavaFX应用程序,您只需要在系统中安装Java8或更高版本. 除此之外,IDE(如E ...

  7. 当引入的类库存在一个类型时,提示“xxx”和“xxx”之间的不明确引用时,消除歧义的方法

    //using _2_命名空间和程序集.WidgetA; //using _2_命名空间和程序集.WidgetB; using System; using System.Collections.Gen ...

  8. 调用phone库,查询手机号码归属地(4)

    需要安装pymysql,phone库 #!/usr/bin/python # -*- coding: utf-8 -*- import sys, pymysql, logging, phone fro ...

  9. 获取url链接上的参数值的函数

    function getUrlParam(name){ var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); var ...

  10. 深度探索C++对象模型之第三章:数据语义学

    如下三个类: class X { }: class Y :public virtual X { }; class Z : public virtual X {}; class A :public Y, ...