HDU1854 Q-Sequence
http://acm.hdu.edu.cn/showproblem.php?pid=1854
随手练习
#include <bits/stdc++.h>
using namespace std;
int t;
string s;
int main(){
scanf("%d",&t);
while(t--){
int flag=;
int zero=;
int one=;
string s2;
cin>>s2;
int len=s2.length();
for(int i=;i<len;i++){
if(s2[i]==''){
zero++;
}else{
if(zero==){
flag=;
}
zero--;
}
}
if(flag) cout<<"No"<<endl;
else{
cout<<"Yes"<<endl;
}
}
return ;
}
HDU1854 Q-Sequence的更多相关文章
- Using dbms_shared_pool.purge to remove a single task from the library cache
我们都知道可是使用 alter system flush shared_pool 来清除shared pool 信息,当时不能指定清除某个对象.因为在系统繁忙的时侯 使用 alter system f ...
- Hibernate映射之实体映射<转载>
实体类与数据库之间存在某种映射关系,Hibernate依据这种映射关系完成数据的存取,因此映射关系的配置在Hibernate中是最关键的.Hibernate支持xml配置文件与@注解配置两种方式.xm ...
- RH033读书笔记(8)-Lab 9 Using vim
Lab 9 Using vim Sequence 1: Navigating with vim 1. Log in as user student 2. [student@stationX ~]$ c ...
- 使用DBMS_SHARED_POOL包将对象固定到共享池
使用DBMS_SHARED_POOL包将对象固定到共享池2011年06月24日 09:45:00 Leshami 阅读数:5808 版权声明:本文为博主原创文章,欢迎扩散,扩散请务必注明出处. htt ...
- idea maven springmvc mybabit 多模块管理整合
一.安装软件jdk1.7,tomcat7.0,idea,mysql,maven 二.在idea中配置jdk 1.依次点开File -->Project Structure,点击左侧标签页,点击S ...
- IGS_学习笔记03_Integrated SOA Gateway设定配置(案例)
20150506 Created By BaoXinjian
- Q - Play With Sequence HDU - 3971 线段树 重新排序建树
Q - Play With Sequence HDU - 3971 这个题目是一个线段树,比较特别的线段树,就是c询问一定次数之后重新排序建树来优化减低复杂度. 第一次碰到这种题目有点迷. 这个题目写 ...
- [LeetCode] Binary Tree Longest Consecutive Sequence 二叉树最长连续序列
Given a binary tree, find the length of the longest consecutive sequence path. The path refers to an ...
- UESTC 1546 Bracket Sequence
Bracket Sequence Time Limit: 3000MS Memory Limit: 65536KB 64 ...
- timus 1175. Strange Sequence 解题报告
1.题目描述: 1175. Strange Sequence Time limit: 1.0 secondMemory limit: 2 MB You have been asked to disco ...
随机推荐
- the art of seo(chapter ten)
Mobile, Local, and Vertical SEO ***The Mobile Landscape***Mobile site speed:• Google Page Speed Insi ...
- Ajax处理后台返回的Json数据
// 处理后台传来的Json字符串装换成Json对象 var dataJson = JSON.parse(data); // 此时可以从Json对象中取值 if(dataJson.result == ...
- listen 61
Multiple Stresses Killed Snail Memory Stress sucks. It can affect your body and mind. Previous resea ...
- certbot申请SSL证书及中间证书问题
首先是到https://certbot.eff.org/上申请证书,由于我们使用的web服务器是基于erlang的cowboy的,在主页上没有选项可以支持,因此在Software下拉项中选择" ...
- 关于STM32中GPIO的8种工作模式
CSDN:http://blog.csdn.net/l20130316 博客园:http://www.cnblogs.com/luckyalan/ 1 综述 I/O口是单片机中非常常用的外设,STM3 ...
- 洛谷 2585 [ZJOI2006]三色二叉树——树形dp
题目:https://www.luogu.org/problemnew/show/P2585 可以把不是绿色的记成一种.仔细一想不会有冲突.如果自己是绿色,孩子的不同颜色不会冲突:如果自己不是绿色,自 ...
- UI 界面:技术决定一切
转自:http://www.cnblogs.com/NEOCSL/archive/2012/12/10/2811153.html 在我看来,肖恩帕克不仅仅是一位技术天才和远见卓识的移动互联网领域先锋. ...
- Linq to Object 延迟标准查询操作符
1.Where 操作符用于限定输入集合中的元素,将符合条件的元素组织声称一个序列结果.2.Select 操作符用于根据输入序列中的元素创建相应的输出序列中的元素,输出序列中的元素类型可以与输入序列中 ...
- Entity Framework之领域驱动设计实践
http://www.cnblogs.com/daxnet/archive/2010/11/02/1867392.html
- CentOS7 安装 odoo10
一.安装Postgresql数据库 #添加RPM yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rh ...