SWUST OJ(1028)
特定字符序列的判断
#include <iostream>
#include <cstdlib>
#include <stack>
#include <string>
using namespace std; int main()
{
stack<char> s;
stack<char> s1;
char c, c1;
string str;
cin>>str;
int i=;
while()
{
c = str[i];
if (c == '#')
{
break;
}
s.push(c);
i++;
} while()
{
c1 = s.top();
s.pop();
if (c1 == '@')
{
break;
}
s1.push(c1);
} if (s.size()!=s1.size())
{
cout<<"no!";
return ;
} while(!s.empty())
{
if(s.top()!=s1.top())
{
cout<<"no!";
return ;
}
s.pop();
s1.pop();
} cout<<"yes!"; return ;
}
SWUST OJ(1028)的更多相关文章
- [Swust OJ 404]--最小代价树(动态规划)
题目链接:http://acm.swust.edu.cn/problem/code/745255/ Time limit(ms): 1000 Memory limit(kb): 65535 Des ...
- [Swust OJ 649]--NBA Finals(dp,后台略(hen)坑)
题目链接:http://acm.swust.edu.cn/problem/649/ Time limit(ms): 1000 Memory limit(kb): 65535 Consider two ...
- SWUST OJ NBA Finals(0649)
NBA Finals(0649) Time limit(ms): 1000 Memory limit(kb): 65535 Submission: 404 Accepted: 128 Descri ...
- [Swust OJ 1023]--Escape(带点其他状态的BFS)
解题思路:http://acm.swust.edu.cn/problem/1023/ Time limit(ms): 5000 Memory limit(kb): 65535 Descript ...
- [Swust OJ 1125]--又见GCD(数论,素数表存贮因子)
题目链接:http://acm.swust.edu.cn/problem/1125/ Time limit(ms): 1000 Memory limit(kb): 65535 Descriptio ...
- [Swust OJ 1126]--神奇的矩阵(BFS,预处理,打表)
题目链接:http://acm.swust.edu.cn/problem/1126/ Time limit(ms): 1000 Memory limit(kb): 65535 上一周里,患有XX症的哈 ...
- [Swust OJ 1026]--Egg pain's hzf
题目链接:http://acm.swust.edu.cn/problem/1026/ Time limit(ms): 3000 Memory limit(kb): 65535 hzf ...
- Light OJ 1028 - Trailing Zeroes (I) (数学-因子个数)
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1028 题目大意:n除了1有多少个因子(包括他本身) 解题思路:对于n的每个因子 ...
- [Swust OJ 1139]--Coin-row problem
题目链接: http://acm.swust.edu.cn/contest/0226/problem/1139/ There is a row of n coins whose values are ...
随机推荐
- 透析SOA、RPC、SOAP、REST、ICE、ESB模型发展史
最初的程序全是单机程序,没有网络,没有RPC,更没有RESTful.程序猿写的东西孤独运行在单机上. 那时的程序猿们语言相通,参与开发同一套系统的团队可以面对面沟通. 网络出现了.网络,也带来变乱.网 ...
- golang 基本数据结构使用
1 goalng struct 1.1 var s1 student 1.2 s2 := student {"zhou", 33} 1.3 s3 := student {Name: ...
- DBC文件小结
Vector的DBC文件描述了CAN网络的通信规范,通过定义signal可以表示CAN帧中的各个物理信号的含义.通过CANdb++ Editor软件可以创建和修改DBC文件,一般监控或控制CAN网络内 ...
- datatable的select()结果直接修改,会体现在表上
如果你只是要修改DataTable里的DataRow的话没有必要找到它的行号,直接在Select后得到的DataRow上修改就行了,它的修改会直接反映到DataTable上(其实就是直接修改了Data ...
- Verify_Execute 验证SQL语句执行结果
#region Verify_Execute /// <summary> /// 验证insert.update.delete执行 /// </summary> /// < ...
- js开发环境配置
使用Sublime Text3作为主要开发工具.下载地址:http://www.sublimetext.com/3. sublime拥有大量实用插件,使用插件需要先下载PackageControl以便 ...
- tensorflow学习笔记1:导出和加载模型
用一个非常简单的例子学习导出和加载模型: 导出 写一个y=a*x+b的运算,然后保存graph: import tensorflow as tf from tensorflow.python.fram ...
- Django session存储到redis数据库
把session存储到redis数据库,需要在setting中配置 django-redis 中文文档 http://django-redis-chs.readthedocs.io/zh_CN/lat ...
- haproxy 配置文件分析
LOG 功能: 编辑/etc/rsyslog.conf 配置文件: # Provides UDP syslog reception $ModLoad imudp #需要启用 $UDPServerRun ...
- xampp——apache服务启动问题(端口占用)
Apache启动提示 20:39:02 [Apache] Error: Apache shutdown unexpectedly.20:39:02 [Apache] This may be due t ...