#include
#include
using namespace std;
typedef int ElemType;
typedef struct LNode
{
ElemType data;
struct LNode *next1,*next2;
}*LinkList;
int main()
{
int n,m,i,t;
cin>>n>>m;
LinkList L,p,tai...
分类:
其他好文 时间:
2014-10-11 18:44:15
阅读次数:
213
function是函数、函数对象、函数指针、和成员函数的包装器,可以容纳任何类型的函数对象,函数指针,引用函数,成员函数的指针普通函数#include void print_num(int i){ cout f_display = print_num;f_display(-9);functi...
分类:
编程语言 时间:
2014-10-11 18:32:05
阅读次数:
205
1.在C语言中,我们没有办法将一个数组作为函数参数传递,如果我们使用数组名作为参数,这个时候数组名立刻会被转换为指向该数组的第一个元素的指针。
关于这一点的理解可以向前深入一步,比如定义的数组为int a[3],那么a作为参数传递之后会变为int *类型;如果定义的数组为int a[3][4],那么a作为参数传递之后被变为int (*)[4];如果定义的数组为int a[3][4][5]...
分类:
其他好文 时间:
2014-10-11 18:27:45
阅读次数:
205
1. c语言中不常见的符号的优先级:
(1). 符号.的优先级高于符号*,所以*p.f应该写作(*p).f。
(2). 符号[]的优先级高于符号*,所以int *p[]和int (*p)[]是两种不同的数组,前者是int *类型的数组而后者是int型数组(该数组是二维数组)。
int a = 1;
int *b = &a;
int c[2][2] = {{2,3},{4,5}};...
分类:
编程语言 时间:
2014-10-11 17:55:25
阅读次数:
141
#include
#include
using namespace std;
typedef int ElemType;
typedef struct LNode
{
ElemType data;
struct LNode *next1,*next2;
}*LinkList;
int main()
{
int n,m,i,t;
cin>>n>>m;
LinkList L,p,tai...
分类:
其他好文 时间:
2014-10-11 17:53:55
阅读次数:
130
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
class Solution {
public:
int largestRectangleArea(int* height, int length) {
...
分类:
其他好文 时间:
2014-10-11 17:37:26
阅读次数:
156
POJ 2777 Count Color
题目链接
就一个线段树,颜色二进制表示就可以,成段更新成段查询延迟操作
代码:
#include
#include
#include
using namespace std;
#define lson(x) ((x<<1)+1)
#define rson(x) ((x<<1)+2)
const int N = 100005...
分类:
其他好文 时间:
2014-10-11 17:36:45
阅读次数:
192
不废话直接代码示例: 1 void f(const int *p) { 2 3 int b = 10; 4 5 *p = 10; // error 6 7 p = &b; // fine 8 9 }10 11 void f(int* const p) {12 13 ...
分类:
其他好文 时间:
2014-10-11 17:15:45
阅读次数:
160
1、一般方法,设置标兵,进行查找class prime{ //检查是否是素数 public void isPrime(){ int m=0; for(int i=1;i<=1000;i++){ double count=0; for(int j =1;...
分类:
编程语言 时间:
2014-10-11 17:07:05
阅读次数:
231
不用Matrix-tree定理什么的,一边kruscal一边 对权值相同的边 暴搜即可。将所有方案乘起来。 1 #include 2 #include 3 using namespace std; 4 int n,m; 5 struct Disjoint_Set 6 { 7 int fa[1...
分类:
Web程序 时间:
2014-10-11 16:55:06
阅读次数:
232