The only difference with version I is: one number can only be used once:class Solution {public: vector > ret; struct Rec { Rec() : sum...
分类:
其他好文 时间:
2014-07-31 05:22:25
阅读次数:
239
解题报告
思路:
字典树应用,dfs回溯遍历字典树
#include
#include
#include
using namespace std;
struct node {
int v;
node *next[26];
};
int l,m,cnt;
char str[100],ch[100],dic[5500][100];
node *newnode()
{
...
分类:
其他好文 时间:
2014-07-31 00:05:35
阅读次数:
283
#ifndef ATOM_INCLUDED
#define ATOM_INCLUDED
extern int Atom_length(const char *str);
extern const char *Atom_new(const char *str, int len);
extern const char *Atom_string(const char *str);
extern con...
分类:
其他好文 时间:
2014-07-31 00:04:09
阅读次数:
289
在3.16-rc4内核源码中,内核给每个进程分配的内核栈大小为8KB。这个内核栈被称为异常栈,在进程的内核空间运行时或者执行异常处理程序时,使用的都是异常栈,看下异常栈的代码(include/linux/sched.h):1 union thread_union {2 struct thre...
分类:
系统相关 时间:
2014-07-30 23:31:05
阅读次数:
411
double getUnixTime(void){ struct timespec tv; if(clock_gettime(CLOCK_REALTIME, &tv) != 0) return 0; return (((double) tv.tv_sec) + (double) (...
分类:
系统相关 时间:
2014-07-30 23:25:05
阅读次数:
228
//code:#include#includeusing namespace std;typedef int status;typedef int elemType;typedef struct lNode{elemType num;struct lNode *next;}lNode,*linkNo...
分类:
其他好文 时间:
2014-07-30 23:13:45
阅读次数:
189
直接递归
代码:
#include
#include
using namespace std;
typedef struct listNode{
int key;
struct listNode *pNext;
} * pNode,Node;
void createNode(pNode &pHead){
bool isFirst=true;
int temp;
sc...
分类:
其他好文 时间:
2014-07-30 20:57:14
阅读次数:
174
//代码为自己编写,可能有问题,欢迎大家留言指正!
#include
#include
using namespace std;
typedef struct dnode
{
int val;
dnode *prior;
dnode *next;
}dnode;
dnode * create();
void traverse(dnode *pHead);
bool insert(dn...
分类:
其他好文 时间:
2014-07-30 20:56:44
阅读次数:
210
#define T Stack_T
typedef struct T *T;
struct T {
int count;
struct elem {
void *x;
struct elem *link;
} *head;
}
const T stk //指针常量, const修饰struct T *。地址不能变。
const struct T *stk //指向常量的指...
分类:
其他好文 时间:
2014-07-30 20:56:14
阅读次数:
187
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define PR 1e-8
#define N 510
struct TPoint{
double x, y, z;
TPoint(){}
...
分类:
其他好文 时间:
2014-07-30 20:55:34
阅读次数:
241