String a="a";String b="b";String c="ab";String d="ab";String e=a+b;程序中用来存放数据的内存分为四块1、全局区(静态区)(static)2、文字常量区 :常量字符串就是放在这块区域,即是我们常说起的常量池。3、栈区(stack):存放...
分类:
编程语言 时间:
2014-10-07 23:48:34
阅读次数:
222
这题昨天比赛的时候逗了,后缀想不出来,因为n^2的T了,就没往后缀数组想……而且之后解题的人又说用二分套二分来做,然后就更不会了……
刚才看了题解,唉……原来题解说n^2的也可以过,然后就……这样了!
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include
#include
#include
#include
#incl...
分类:
其他好文 时间:
2014-10-07 12:48:13
阅读次数:
196
前面我们写过类似的Stack:template >class Stack{public: void push(const T &); void pop(); T top() const; bool empty() const;private: Al...
分类:
其他好文 时间:
2014-10-07 01:19:22
阅读次数:
349
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