package main import ( "encoding/json" "fmt" "os") type ConfigStruct struct { Host string `json:"host"` Port ...
分类:
Web程序 时间:
2014-08-12 05:44:33
阅读次数:
231
解题报告
题目传送门
题意:
求矩形并面积。
思路:
离散+线段树+扫描线。
#include
#include
#include
#include
using namespace std;
struct Seg {
int v;
double h,lx,rx;
friend bool operator < (Seg a,Seg b) {
...
分类:
其他好文 时间:
2014-08-12 00:49:03
阅读次数:
260
listen函数的定义如下所示:
#include
int accept(int sockfd, struct sockaddr * restrict addr, socklen_t *restrict len);
返回值:若成功则返回文件(套接字)描述符,若出错则返回-1
int listen(int sockfd, int backlog);返回值:若成功则返回0;若出错则返回-1...
分类:
其他好文 时间:
2014-08-12 00:47:03
阅读次数:
242
进程调度所使用到的数据结构:1.就绪队列内核为每一个cpu创建一个进程就绪队列,该队列上的进程均由该cpu执行,代码如下(kernel/sched/core.c)。1 DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);定义了一个struct rq...
分类:
系统相关 时间:
2014-08-12 00:23:03
阅读次数:
468
#include #include #include #include #include #include #define LL __int64#define N 210using namespace std;struct Line{ double x,y1,y2; int f;}line[N];s...
分类:
其他好文 时间:
2014-08-12 00:01:33
阅读次数:
240
struct类型适于表示Point、Rectangle和Color等轻量对象。尽管使用自动实现的属性将一个点表示为类同样方便,但在某些情况下使用结构更加有效。例如,如果声明一个 1000 个Point对象组成的数组,为了引用每个对象,则需分配更多内存;这种情况下,使用结构可以节约资源。因为 .NET...
分类:
其他好文 时间:
2014-08-11 23:57:43
阅读次数:
530
解题报告
题意:
插队完的顺序。
思路:
倒着处理数据,第i个人占据第j=pos[i]+1个的空位。
线段树维护区间空位信息。
#include
#include
#include
using namespace std;
struct node {
int x,v;
} num[201000];
int sum[1000000],ans[201000];
void c...
分类:
其他好文 时间:
2014-08-11 21:34:33
阅读次数:
378
Dijkstra部分不难,主要是建图
#include
#include
#include
#include
#include
#include
using namespace std;
#define INF 10000000
#define maxn 1005
struct bian
{
string a;
string b;
int time;
}tu[maxn];...
分类:
其他好文 时间:
2014-08-11 21:32:42
阅读次数:
185
//单链表的合并
//链表合并
//两个链表必须是有序的
#define Maxsize 5
typedef int elemtype;
typedef struct linklist
{
elemtype data;
struct linklist *next;
}Linklist;
//建立链表1
Linklist *CreateList1 ()
...
分类:
其他好文 时间:
2014-08-11 21:25:52
阅读次数:
346
struct类型是一种值类型,通常用来封装小型相关变量组,例如,矩形的坐标或库存商品的特征。下面的示例显示了一个简单的结构声明。1 public struct Book2 {3 public decimal price;4 public string title;5 publ...
分类:
其他好文 时间:
2014-08-11 21:11:02
阅读次数:
183