Codeforces 1167A-Telephone Number
题目链接: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的更多相关文章
- 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 ...
- Codeforces 55D Beautiful Number
Codeforces 55D Beautiful Number a positive integer number is beautiful if and only if it is divisibl ...
- Codeforces 40 E. Number Table
题目链接:http://codeforces.com/problemset/problem/40/E 妙啊... 因为已经确定的格子数目严格小于了$max(n,m)$,所以至少有一行或者一列是空着的, ...
- Codeforces 124A - The number of positions
题目链接:http://codeforces.com/problemset/problem/124/A Petr stands in line of n people, but he doesn't ...
- codeforces Soldier and Number Game(dp+素数筛选)
D. Soldier and Number Game time limit per test3 seconds memory limit per test256 megabytes inputstan ...
- Codeforces 55D Beautiful Number (数位统计)
把数位dp写成记忆化搜索的形式,方法很赞,代码量少了很多. 下面为转载内容: a positive integer number is beautiful if and only if it is ...
- Codeforces 980E The Number Games 贪心 倍增表
原文链接https://www.cnblogs.com/zhouzhendong/p/9074226.html 题目传送门 - Codeforces 980E 题意 $\rm Codeforces$ ...
- Codeforces 980E The Number Games - 贪心 - 树状数组
题目传送门 传送点I 传送点II 传送点III 题目大意 给定一颗有$n$个点的树,$i$号点的权值是$2^{i}$要求删去$k$个点,使得剩下的点仍然连通,并且总权值和最大,问删去的所有点的编号. ...
- [CodeForces - 919B] Perfect Number
题目链接:http://codeforces.com/problemset/problem/919/B AC代码: #include<cstdio> using namespace std ...
- Codeforces 995 E - Number Clicker
E - Number Clicker 思路:双向搜索 代码: #include<bits/stdc++.h> using namespace std; #define fi first # ...
随机推荐
- visual_c++外挂教程(详细)
课程分四个大章节 初级篇,中级篇,进阶篇,高级篇 初级篇内容:编写一个完整的,简单的外挂 C++的数据类型:Byte,Word,DWORD,int,float API函数的调mouse_event,G ...
- JZOI1134 迷宫(maze)
#include <bits/stdc++.h> #define ll long long #define INF 2147483647 #define mem_INF 213906214 ...
- Linux初上手!
虚拟机Virtual Box装的Kali Linux,是Debian的发行版本,安装过程不说了,不是硬盘安装也没什么说的,由于是新手所以只有两个分区,一个[/]和一个[swap] 装好之后是xwind ...
- 红黑数之原理分析及C语言实现
目录: 1.红黑树简介(概念,特征,用途) 2.红黑树的C语言实现(树形结构,添加,旋转) 3.部分面试题() 1.红黑树简介 1.1 红黑树概念 红黑树(Red-Black Tree,简称R-B T ...
- Echart使用js进行封装成函数
Echart使用js进行封装成函数 主要是对 json 串的封装,使用 js 进行对 json 的解析.之间用的最多是循环取出数组中的值,如果拿去使用可直接修改 json 就好. 上一篇把二维的封装好 ...
- Dubbo入门到精通学习笔记(一):Dubbo对传统工程进行改造、注册中心安装(Zookeeper-3.4.6)、工程结构优化
文章目录 改造思路 样例工程:传统的单工程项目(edu-demo) 模型结构 思路 改成dubbo调用方式后的工程结构 部署环境规划 改造 愚公移山 迁移包 迁移页面: 迁移配置相关 新项目的主要作用 ...
- Linux SSH证书登陆
创建证书 ssh-keygen -t rsa -b 4096 -C "your_email@example.com" 证书导入以后,执行 eval "$(ssh-agen ...
- 关于Web中的图标使用问题
挺懒的,这里做个记录. Web中的图标使用问题 : https://github.com/amfe/article/issues/2
- 42-Ubuntu-用户管理-07-修改权限命令介绍
修改文件权限 序号 命令 作用 01 chown 修改文件/目录拥有者 02 chgrp 修改文件/目录所在主组 03 chmod 修改文件/目录权限 chmod chown chgrp ...
- 2018年第九届蓝桥杯B组第四题:摔手机题解
摔手机 摔手机 动态规划 在蓝桥杯的时候遇到一次 当时没有做对 看了题解也没明白 如今再次遇到这个类似的题目 于是拿出来补补吧 摔手机题目如下: 星球的居民脾气不太好,但好在他们生气的时候唯一的 ...