n个点m条无向边
输出一条哈密顿回路
#include
#include
#include
using namespace std;
const int N = 155;
int n, m;
bool mp[N][N];
int S, T, top, Stack[N];
bool vis[N];
void _reverse(int l,int r) {
while...
分类:
其他好文 时间:
2014-10-06 23:35:01
阅读次数:
189
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
考察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
webrx-title
/*returnTop*/
p#back-to-top{
position:fixed;
display:none;
bottom:100px;
right:80px;
}
p#back-to-top a{
text-align:center;
text-decoration:none;...
分类:
Web程序 时间:
2014-10-06 11:26:30
阅读次数:
206
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1022模拟栈:代码#includeint main(void){ int n,i,j,k,t,r[23],stack[13]; char si[13],so[13]; while(scan...
分类:
其他好文 时间:
2014-10-06 00:35:09
阅读次数:
223
当我们调用copy函数时,要确保目标容器足够大,例如://将vec的所有元素拷贝到以coll.begin()为起始地址的位置copy(vec.begin(), vec.end(), coll.begin());如果之前没有为coll分配好足够的内存,就会引发越界错误。如果我们无法提前为coll预分配...
分类:
其他好文 时间:
2014-10-05 23:38:49
阅读次数:
272