poj 1126 Simply Syntax
来源:互联网 发布:淘宝怎么充钱余额 编辑:程序博客网 时间:2024/05/24 06:42
题意:这道题目是与语法规则有关的,首先这些语法规则满足下面的条件:
0.The only characters in the language are the characters p through z and N, C, D, E, and I.
1.Every character from p through z is a correct sentence. //只有p到z的语法正确
2.If s is a correct sentence, then so is Ns. //若s语法正确那么Ns语言也正确
3.If s and t are correct sentences, then so are Cst, Dst, Est and Ist.//若s和t语法正确, Cst, Dst, Est, Ist语法也正确
题目输入了一些数据,问这些数据是否满足了语法规则。
题目思路:显然无论怎么样该语法的最后一个字符一定是p到z之间,所以我们可以反转这个数据,然后再进行判断。
思路来源:discuss,很不错的一个想法。
代码:
- poj 1126 Simply Syntax
- POJ 1126 Simply Syntax
- POJ 1126:Simply Syntax
- POJ 1126 Simply Syntax 笔记
- POJ:1126 Simply Syntax(思维)
- poj 1126 Simply Syntax (反向枚举)
- poj 1126 Simply Syntax 右线性文法的归约
- POJ-1126——Simply Syntax (暴力扫一遍)
- POJ1126 Simply Syntax (递归)
- HDOJ 1433 Simply Syntax
- Hdoj 1433 Simply Syntax 【string】
- hdoj Simply Syntax 1433 (模拟)
- hdoj 1433 Simply Syntax【模拟】
- POJ 1126 Simple Syntax
- Hdu 1433 Simply Syntax【dfs枚举】
- hdoj.1433 Simply Syntax【递归调用】 2015/04/24
- POJ 2022 Syntax Included 笔记
- Simply JavaScript
- Drv总结
- 软件开发过程文档如何写作?——“文档==鸡肋”?
- 【计算机系统学习-信息表示和处理】【一、信息的存储】
- 1.4 Mote-PC serial communication and SerialForwarder 学习笔记
- inner join用法
- poj 1126 Simply Syntax
- 网络游戏《抽象空间》概念
- Orthogonal Nonnegative Matrix Tri-factorizations for Clustering
- silverlight多人在线游戏示例
- JSON数据格式
- 如何备份gnome-panel的设置
- silverlight游戏时间同步系统
- object例子
- J2ME Timer 使用指南