已知圆心(0,0)圆周上的一点,求圆周上另外两点使得三点构成等边三角形。
懒得推公式,直接用模板2圆(r1=dist,r2=sqrt(3)*dist)相交水过
#include
#include
#include
#include
#include
using namespace std;
#define eps 1e-6
typedef long long ll;
inline double...
分类:
其他好文 时间:
2014-06-30 08:11:07
阅读次数:
310
给一个带权有向图,求其中是否存在环,若存在,输出环上边权的平均值最小的那个的平均值。
点的范围就50,感觉可以很暴力。。但显然超时了
感觉方法好巧妙,二分平均值,将所有边权减去二分的那个值,然后spfa判断是否有负环
若有负环,则图中存在的所有环的边权平均值一定比枚举值大
反之则小,要是无论枚举值多大都没有负环,说明图中没有环。
#include
#include
#incl...
分类:
其他好文 时间:
2014-06-28 07:00:08
阅读次数:
298
转自:http://www.cnblogs.com/sniperHW/category/374086.htmlcocos2dx内存管理摘要: cocos2dx基于引用计数管理内存,所有继承自CCObject的对象都将获得引用计数的能力,可通过调用retain成员函数用于引用计数值,调用release...
分类:
编程语言 时间:
2014-06-27 22:25:48
阅读次数:
569
题目:Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?个人思路:1、判断一个链表是否有环,标准做法...
分类:
其他好文 时间:
2014-06-27 19:41:40
阅读次数:
165
I I U P C 2 0 0 6
Problem G: Going in Cycle!!
Input: standard input
Output: standard output
You are given a weighted directed graph with n vertices and...
分类:
其他好文 时间:
2014-06-27 08:07:16
阅读次数:
183
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:
其他好文 时间:
2014-06-25 21:00:45
阅读次数:
200
赋值语句variable=expression几种赋值的实例:x = x1+x2;x = sum(of x1-x6); 括号中要用ofsum(x,y);如果x或y中有一个为缺失值,sum的结果会将缺失值设为0,而如果用z=x+y;有缺失值的话z的结果会为缺失值ar(1) = br(1); *将数组b...
分类:
其他好文 时间:
2014-06-25 00:36:53
阅读次数:
1693
1.Ref,AutorealsePool,PoolManager是紧密相关的
2.Ref的retain、new 应该与 release或者autoRealse成对出现。
3.Node的使用方式。...
分类:
其他好文 时间:
2014-06-22 22:54:51
阅读次数:
293
这里只讲述http{}模块下的配置:
在ngx_http_block()函数内(这个函数别调用时在ngx_inti_cycle内的ngx_conf_parse函数,这个函数遇到http命令时 回调ngx_http_block,开启http{}配置块的解读工作),针对每一个http模块,调用init_conf之后,有调用了ngx_http_merge_servers()。这是为何!
...
分类:
其他好文 时间:
2014-06-22 20:34:44
阅读次数:
204
作为一个web服务器,那么肯定是有监听套接字的,这个监听套接字是用于接收HTTP请求的,这个监听套接字的创建是根据配置文件的内容来创建的,在nginx.conf文件中有多少个地址就需要创建多少个监听套接字。这里不说各个结构体的构造 只说大体情况!
1)、首先在main函数中调用了ngx_init_cycle()函数,在这个函数的最后调用了ngx_open_listening_sockets函...
分类:
其他好文 时间:
2014-06-22 16:45:32
阅读次数:
139