半平面交模板#include #include #include #include #include using namespace std;const int MAXN=110;const double eps=1e-8;struct point { double x,y;};point pts[...
分类:
其他好文 时间:
2014-08-06 18:14:31
阅读次数:
240
发现好多半平面交用N^2的增量法都能过诶。。。#include #include #include #include #include using namespace std;const int MAXN=1550;const double eps=1e-8;struct point { doubl...
分类:
其他好文 时间:
2014-08-06 17:52:11
阅读次数:
261
以下摘自linux下的man文件:(man getitimer) #include int getitimer(int which, struct itimerval * curr_value); int setitimer(int which, const struct itimerval...
分类:
系统相关 时间:
2014-08-06 14:45:41
阅读次数:
370
#include #include int main() { struct tm tm; char buf[255]; strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm); strftime(buf, sizeof(buf), "%.....
分类:
其他好文 时间:
2014-08-06 14:44:11
阅读次数:
372
Your intuition would tell you that there's a O(n) solution. Actually it is another stack-based problem to solve.class Solution {public: struct Rec ...
分类:
其他好文 时间:
2014-08-06 14:37:41
阅读次数:
186
1、值类型表示实际的数据,存储在堆栈中。值类型包括(简单类型【整数类型、布尔类型、字符类型、实数类型】、枚举类型【关键字enum声明】、结构类型【单一实体的类型就叫做实体类型。关键字struct声明,可以带构造函数】)2、引用类型表示指向数据的指针或引用,可存储对实际数据的引用。引用类型包括(类、接...
分类:
其他好文 时间:
2014-08-06 14:22:21
阅读次数:
175
线段树 1 #include 2 using namespace std; 3 4 const int maxn = 1000005; 5 const int INF = 1000000009; 6 7 struct node { 8 int sum,ma,mi; 9...
分类:
其他好文 时间:
2014-08-06 14:09:11
阅读次数:
374
1.二叉树的相关算法的实现(链表)。
#include
#include
#define NULL 0
typedef struct tree
{
int data;
struct tree *left, *right;
}ElemBT;
void create_btree(ElemBT *root, int list[], int n) /*n表示list数组中元素的个数*/
{...
分类:
其他好文 时间:
2014-08-06 12:00:01
阅读次数:
183
很容易想到用先序遍历,并传递进去一个数组和当前和。just so so
代码:
#include
#include
#include
using namespace std;
typedef struct tree{
int data;
struct tree * lchild;
struct tree * rchild;
}Tree,*pTree;
void create...
分类:
其他好文 时间:
2014-08-06 11:55:31
阅读次数:
227
关于Linux下时间编程的问题:1. Linux下与时间有关的结构体struct timeval{int tv_sec;int tv_usec;};其中tv_sec是由凌晨开始算起的秒数,tv_usec则是微秒(10E-6 second)。struct timezone{int tv_minut.....
分类:
系统相关 时间:
2014-08-06 11:35:41
阅读次数:
313