码迷,mamicode.com
首页 >  
搜索关键字:veth pair    ( 2862个结果
LeetCode:Max Points on a Line
题目描述: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 解题思路:暴力求解。以每个点为中心,然后遍历剩余的点。对每个点,初始化一个map,以pair为key(dx,dy为两点之间x坐标与y坐标的差除以他们的最大公约数之后得到...
分类:其他好文   时间:2014-11-10 12:07:20    阅读次数:152
《Crazy tea party》
Descriptionn participants of ?crazy tea party? sit around the table. Each minute one pair of neighbors can change their places. Find the minimum time ...
分类:其他好文   时间:2014-11-09 00:56:48    阅读次数:241
nginx中父子进程工作的主体函数
根据Nginx(0.7.67版本)的代码,对Nginx基本的进程创建,进程主体以及事件处理进行了简要的分析。 基本上,父进程(即主进程)一开始会初始化及读取配置,并加载各模块的功能,然后fork()出N个子进程(即工作进程),具有相同的工作逻辑和功能。父进程负责监听信号(如HUP,QUIT等),通过socket pair把信号传递给子进程(子进程间一般不通信)。子进程通过事件来处理父进程...
分类:系统相关   时间:2014-11-08 20:55:14    阅读次数:336
[组合数取模-逆元计算模板] zoj 3624 Count Path Pair
思路: 正难则反 //C(M+N,M)*C(Q+M-P,Q)-C(N+M-P,N)*C(M+Q,M); 代码: #include"cstdlib" #include"cstdio" #include"cstring" #include"cmath" #include"stack" #include"algorithm" #include"iostream" using namespace...
分类:其他好文   时间:2014-11-08 16:51:23    阅读次数:164
POJ 3252 Round Numbers(数位dp)
题意:给定区间[l,r],l 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define pb push_back 8 #define mp make_pair 9 #define esp 1e-810 #define...
分类:其他好文   时间:2014-11-07 14:36:50    阅读次数:208
【STL】关联容器 — hash_set
容器hash_set是以hash table为底层机制的,差点儿所有的操作都是转调用hash table提供的接口。因为插入无法存储同样的键值,所以hash_set的插入操作所有都使用hash table的insert_unique接口,代码例如以下:pair insert(const value_...
分类:其他好文   时间:2014-11-06 19:04:34    阅读次数:200
poj 3083
1 #include 2 #include 3 #include 4 using namespace std; 5 6 typedef pair P; 7 8 char maze[41][41]; 9 int dist[41][41]; 10 int spDirX[4...
分类:其他好文   时间:2014-11-05 01:51:50    阅读次数:203
python基础-socket通信
socket是一种双向通信的起点和重点,氛围服务器端和客户端Socket服务器端用到的方法有MethodDescriptions.bind()This method binds address (hostname, port number pair) to socket.s.listen()This...
分类:编程语言   时间:2014-11-02 00:36:49    阅读次数:145
sort 对坐标 排序
bool compare(const pair &a,const pair&b) { return a.first v; v.push_back(make_pair(4,2)); v.push_back(make_pair(2,4)); sort(v.begin(),v.end(),compare);...
分类:编程语言   时间:2014-11-01 14:54:47    阅读次数:1098
POJ 1830 开关问题 高斯消元
基础的高斯消元解决异或方程问题。#include #include #include #include #include #include #include #include #include #include using namespace std; #define MP make_pair#de...
分类:其他好文   时间:2014-11-01 11:23:59    阅读次数:156
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!