Let us define a regular brackets sequence in the following way:
1. Empty sequence is a regular sequence.
2. If S is a regular sequence, then (S) and [S] are both regular sequences.
3. If A an...
分类:
其他好文 时间:
2014-08-16 15:10:30
阅读次数:
262
Evaluating Simple C ExpressionsThe task in this problem is to evaluate a sequence of simple C expressions, buy you need not know C to solve the proble...
分类:
其他好文 时间:
2014-08-15 12:44:48
阅读次数:
223
DescriptionBackgroundOur knight lives on a chessboard that has a smaller area than a regular 8 * 8 board,but it is still rectangular.Can you help this...
分类:
其他好文 时间:
2014-08-14 03:46:57
阅读次数:
305
#includeconst int maxn=100 +10;int val[maxn],vtop;int op[maxn],otop;void insert(int b){ while(otop &&op[otop-1]==3) { b=!b; --otop; } val[vtop++]=b;.....
分类:
其他好文 时间:
2014-08-13 12:59:36
阅读次数:
243
原文:浅谈正则表达式一、什么是正则表达式?
简单的说:正则表达式(Regular Expression)是一种处理字符串匹配的语言;
正则表达式描述了一种字符串匹配的模式,可以用来检查一个字符串是否含有某种子串,对匹配到的子串进行“取出”或“替换”操作。
二、正则表达式的应用
正则表达式在实际的开发...
分类:
其他好文 时间:
2014-08-13 12:29:46
阅读次数:
206
题目链接
题意:给n个点,问是否能画出一个无向图,且每个顶点连接3条边,如果可以的话输出连接的边。
思路:当增加一条边时,总的无向图的度数会增加2,所以度数之和n*2为偶数。当n为奇数时,度数之和为奇数,所以不存在。当n为偶数时才符合条件。注意特判n为2时的情况。输出的话,就头尾相连,然后i与i+(n/2)相连。
#include
#include
#include...
分类:
其他好文 时间:
2014-08-12 10:23:24
阅读次数:
170
转自:http://www.cnblogs.com/yejianfei/archive/2012/10/07/2713715.html我们最经常遇到的验证,就是电子邮件地址验证。网站上常见。各种网页脚本也都常用“正则表达式”(regular expression)对我们输入的电子邮件地址进行验证,判...
分类:
编程语言 时间:
2014-08-11 20:28:42
阅读次数:
293
Linux平台上被广泛使用的正则表达式库PCRE - Perl-compatible regular expressions,从其名字即可知道,PCRE提供的是一套与Perl中相兼容的正则表达式。元字符(Meta-character)'\' :在任何元字符前面加上反斜线,就会使它失去元字符的特殊作....
分类:
其他好文 时间:
2014-08-11 20:26:42
阅读次数:
286
介绍C++类型转换的用法。1.static_caststatic_cast用与强制隐式类型转换,即隐式类型转换的反方向。static_cast,限制条件少,不进行运行时检验。必须用于当你知道对象的具体类型时,这样检验是不必要的,否则,不安全。example:void func(void *data)...
分类:
编程语言 时间:
2014-08-11 00:17:51
阅读次数:
390
Description
Problem H
Counting Rectangles
Input: Standard Input
Output:Standard Output
Time Limit: 3Seconds
Given n points on the XY plane, count how many regular rectanglesare formed. A...
分类:
其他好文 时间:
2014-08-10 18:49:00
阅读次数:
268