在使用消息队列时,调用#include #include #include #include
#include #include struct mymsg{ long mytype; char even[32];};#define VALUE
(key_t)0x1fffint main(){ ...
分类:
系统相关 时间:
2014-05-14 00:48:02
阅读次数:
487
1 /** 2 大意: 求[a,b] 之间 phi(a) + phi(a+1)...+ phi(b);
3 思路: 快速求欧拉函数 4 **/ 5 6 #include 7 #include 8 using namespace std; 9 #define Max
300000010 11 ...
分类:
其他好文 时间:
2014-05-14 00:47:07
阅读次数:
287
【问题】
求一个给定的加权连通图的最小生成树问题。
【代码】
#include
#include
#define MAXNUM 1000
#define MAX_VERTEX_NUM 20
typedef char Vertextype;
typedef struct node
{
int weight;
}Adjmatrix[MAX_VERTEX_NUM][MAX_VERT...
分类:
其他好文 时间:
2014-05-13 23:55:49
阅读次数:
464
题目:Evaluate the value of an arithmetic expression
inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an
integer or another expr...
分类:
其他好文 时间:
2014-05-13 22:43:01
阅读次数:
335
1 题目大意给出一个n,求sum(gcd(i,j),014 #include 15 using
namespace std;16 #define Max 100000017 18 long long phi[Max+5],ans[Max+5];19 int
prime[Max/3];20 bool....
分类:
其他好文 时间:
2014-05-13 22:40:58
阅读次数:
251
二分查找的一点思考二分查找算法实现#define
LOCAL#include#include#includeint const MAX_N=21) { int mid=(ub+lb)/2;
if(a[mid]>=k) { ub=m...
分类:
其他好文 时间:
2014-05-13 21:53:37
阅读次数:
328
1 /** 2 大意: 求[1,m], [1,n] 之间有多少个数互素。。。做了 1695
,,这题就so easy 了 3 **/ 4 #include 5 #include 6 #include 7 using namespace std; 8
const long long max...
分类:
其他好文 时间:
2014-05-13 21:28:49
阅读次数:
349
代码片段(假设只有3个key=value):public static void
main(String[] args) throws IOException { BufferedReader br = new BufferedReader(
new In...
分类:
其他好文 时间:
2014-05-13 19:48:10
阅读次数:
485
一、简介MSM(memcached-session-manager)支持tomcat6和tomcat7,利用Value(Tomcat阀对Request进行跟踪。Request请求到来时,从memcached加载session,Request请求结束时,将tomcatsession更新至memcached,以达到session共享之目的,支持sticky和non-sticky模式。Sticky模式:..
分类:
其他好文 时间:
2014-05-13 05:04:23
阅读次数:
517
publicstaticStringcreateJsonString(Stringkey,Objectvalue){
JSONObjectjsonObject=newJSONObject();
jsonObject.put(key,value);
returnjsonObject.toString();
}
分类:
Web程序 时间:
2014-05-13 04:28:35
阅读次数:
316