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 ...
随机推荐
- IDEA编译less插件LESS CSS Compiler的安装
1.IDEA插件地址:LESS CSS Compiler 百度云盘下载地址 2.安装Node.js,下载 3.打开idea→settings→plugins 安装:“nodejs”插件,并按以下步骤进 ...
- 【Lintcode】177.Convert Sorted Array to Binary Search Tree With Minimal Height
题目: Given a sorted (increasing order) array, Convert it to create a binary tree with minimal height. ...
- MQTT协议简介及协议原理
MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基于发布/订阅(publish/subscribe)模式的“轻量级”通讯协议,该协议构建 ...
- javascript私有属性失效及解决方案
1.js创建私有属性的方法 在 javascript 中所有对象的成员是公有的 构造函数也是如此: function Gadget ( ) { this.name = ' jack '; this.p ...
- docker添加阿里云镜像加速器
.docker添加阿里云镜像加速器 https://blog.csdn.net/chenjin_chenjin/article/details/86674521 .配置阿里云加速器 阿里云会根据账号生 ...
- shader之顶点着色器
Vertex Shader 是渲染管道中一个可编程的模块,用于处理独立的顶点.Vertex Shader接收Vertex Attribute Data,由定点数组对象通过渲染指令来生成. Vertex ...
- 23.Consent 代码重构
新建Services文件,并新建类ConsentService类把,ConsetController里面不是Action的方法都放在这个ConsentService类里面 先把构造函数完善 把这些私有 ...
- python 学习笔记8 (模块)
Python 模块(Module),是一个 Python 文件,以 .py 结尾,包含了 Python 对象定义和Python语句. 模块让你能够有逻辑地组织你的 Python 代码段. 把相关的代码 ...
- C#Timer停不住
System.Timers.Timer timer1 = new System.Timers.Timer(); timer1.Interval = ; //1天循环一次 timer1.Elapsed ...
- EF外键保存数据
using (DataContext dbcontext=new DataContext ()) { //emp.department.ID = dep.ID; //emp.department = ...