public static boolean includingNUM(String str)throws Exception{Pattern p = Pattern.compile("[\u4e00-\u9fa5]*[\\d|\\w]+[\u4e00-\u9fa5]*");//或者 Pattern ...
分类:
编程语言 时间:
2014-10-06 23:11:51
阅读次数:
262
hdu5044 Tree 树链剖分,点剖分,边剖分,非递归版
//#pragma warning (disable: 4786)
//#pragma comment (linker, "/STACK:16777216")
//#pragma comment(linker, "/STACK:60400000,60400000")
//HEAD
#include
#include
#i...
分类:
其他好文 时间:
2014-10-06 21:36:10
阅读次数:
663
在之前,我们写过类似的stack template >
class Stack
{
public: void push(const T &); void pop(); T top() const; bool empty() const;
private: Alloc cont_;
}; 那么我们使用...
分类:
其他好文 时间:
2014-10-06 21:18:20
阅读次数:
291
So far we have seen stack diagrams, which show the state of a program, and object diagrams, which show the attributes of an object and their values. T...
分类:
其他好文 时间:
2014-10-06 20:39:30
阅读次数:
117
缺少X11显示设置Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation.....
分类:
系统相关 时间:
2014-10-06 17:19:30
阅读次数:
528
考察DFS的应用,用栈描述字符串的变化过程。 1 #include 2 #include 3 int len1,len2; 4 char str1[100],str2[100],stk[100],ans[200]; 5 6 void output(int n){ 7 int i; 8 ...
分类:
其他好文 时间:
2014-10-06 17:03:40
阅读次数:
147
题目链接:点击打开链接
题意:给定n*m的矩阵
X代表有色 .代表无色
用一个x*y的矩阵形刷子去涂色。
刷子每次可以→或↓移动任意步。
若能够染出给定的矩阵,则输出最小的刷子的面积
若不能输出-1
思路:
先找到连续最小的x,y
因为至少一个边界和x或y相等,所以枚举(x,i) 和 (i,y)就可以了。
#pragma comment(linker, "/STACK:...
分类:
其他好文 时间:
2014-10-06 12:44:55
阅读次数:
211
题目链接:点击打开链接
题意:
就是n*m的矩阵,
每行能走的方向
每列能走的方向
问:图是否强连通。
只要4个边界成环即可。
或者无脑tarjan
==
#pragma comment(linker, "/STACK:102400000,102400000")
#include
#include
#include
#include
#include
using nam...
分类:
其他好文 时间:
2014-10-06 12:12:10
阅读次数:
228
Java包含两种异常:checked异常和unchecked异常。C#只有unchecked异常。checked和unchecked异常之间的区别是:Checked异常必须被显式地捕获或者传递,如Basic try-catch-finally Exception Handling一文中所说。而unc...
分类:
编程语言 时间:
2014-10-06 00:50:49
阅读次数:
384