题目链接: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. Spring Boot下启用https

    1.需要一个证书,可以自己生成或者购买.下面是我们通过keytool自己生成. 打开运行,输入cmd,进入命令行 输入生成命令: keytool -genkey -alias tomcat -stor ...

  2. ssm+mysql 时间显示相差了12小时的问题 Gson

    怎么改时区,连接字符串加时区都无效,后来才发现原来返回的是对的,并不是时区问题. 后来感觉是gson问题,关键是在其他数据表并没有这个问题. 把 gson改成 Gson gson = new Gson ...

  3. eclipse spring boot 项目出现java.lang.ClassCastException 解决方法

    问题 eclipse spring boot 项目出现java.lang.ClassCastException 解决方法: 重新生成项目

  4. 初探gitlab & gitlab-runner & asp.net core持续集成

    文章简介  gitlab & gitlab-runner 简介 基于gitlab & gitlab-runner 的asp.net core webapi 极简持续集成实践 gitla ...

  5. C++——代码风格

    google代码风格 1.使用安全的分配器(allocator),如scoped_ptr,scoped_array 2.测试用的,其他的不能用: 2.1 友元 2.2 C++异常 2.3 RTTI 3 ...

  6. HDU 6574 Rng

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6574 思路:用古典概型的方法计算俩个区间不想交的概率,再用 1 减去即可. 由于 枚举俩种括号的所有可 ...

  7. msf反弹shell

    今天回顾了一下msf反弹shell的操作,在这里做一下记录和分享.( ̄︶ ̄)↗ 反弹shell的两种方法 第一种Msfvenom实例: 1.msfconsole #启动msf 2.msfvenom - ...

  8. jquery 弥补ie6不支持input:hover状态

    <!doctype html><html>    <head>    <meta charset="utf-8">    <t ...

  9. jmeter 读写excel插件编写教程系列(1) -开篇

    不知道为什么,jmeter 竟然不提供 读写excel 的Sampler! 但是在我们自动化接口测试过程中,参数化.保存测试数据,用excel 是比较好的解决方案! 接下来一段儿时间,大虫会抽出一些时 ...

  10. JDK8之新特性扩展篇

    之前分篇章讲了一些JKD8中添加的新特性,还有一些新特性这里也一并讲下. BASE64 base64编码解码已经被加入到了jdk8中了. import java.nio.charset.Standar ...