- 博客(29)
- 收藏
- 关注
原创 Centos7 安装Rabbitmq
1. Rabbitmq 服务端基于Erlang语言编写,首先在安装rabbitmq 之前安装erlang 环境。·安装erlang:安装依赖环境:yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel
2017-09-10 22:25:18
263
原创 CookieLocaleResolver
This locale resolver inspects aCookie that might exist on the client to see if aLocale or TimeZoneis specified. If so, it uses the specified details. Using the properties of this locale resolv
2017-02-09 10:52:05
959
原创 spring URI Template Patterns
In Spring MVC you can use the@PathVariable annotation on a method argument to bind it to thevalue of a URI template variable:@GetMapping("/owners/{ownerId}")public String findOwner(@PathVar
2017-02-09 09:18:30
521
原创 spring xml Collections
In the, ,, and elements, you set the properties and arguments of the JavaCollection types List, Set,Map, and Properties, respectively .administrator@example.orgsupport@example.org
2017-02-08 14:39:59
202
原创 spring 配置文件引用
You can use the application context constructor to load bean definitions from all these XML fragments. This onstructor takes multipleResource locations, as was shown in the previous section. Alter
2017-02-08 13:37:26
265
原创 nginx 配置
weight=number 设置服务器的权重,默认为1max_fails=number 设置在fail_timeout 时间内不成功的尝试次数,判断此机器是否可用,默认尝试次数为1fail_timeout=time 设置判断机器是否可用尝试的时间,默认时间为10sbackup 标明此机器为备份机器,当主机器不可用的时候起作用。down 标明此机器不可用。
2016-08-24 08:23:10
264
原创 hdu Largest prime factor
#include #include #include #define maxn 1000100using namespace std;int f[maxn];void inti(){ int num=0; for(int i=2; i<maxn; i++) { if(f[i]==0) { num++;
2014-04-13 18:14:13
394
原创 hdu Examining the Rooms
这道题的知识点第一次听说 ,就是应用斯特林数。题目的意思是给你房间数N,和最多能破门的个数,让你求能全部把房间打开的概率!a[i][j]=a[i-1][j-1]+(i-1)*a[i-1][j];
2014-04-13 10:29:00
420
原创 hdu 1081 To The Max
http://acm.hdu.edu.cn/showproblem.php?pid=1081#include #include #include #define maxn 300using namespace std;const int inf=0x7fffffff;int dp[maxn][maxn];int a[maxn][maxn];int main(){
2014-04-04 20:47:44
340
原创 ural 1353. Milliard Vasya's Function
这道题就是求从1到10^9中个位数字之和为s的数的个数。#include #include #include using namespace std;int dp[10][82];void inti(){ memset(dp,0,sizeof(dp)); dp[0][0]=1; for(int i=1; i<=9; i++) { f
2014-03-28 19:07:46
385
原创 ural 1203. Scientific Conference
http://acm.timus.ru/problem.aspx?space=1&num=1203#include #include #include #define maxn 400000using namespace std;struct node{ int s,e; bool operator <(const node &a)const {
2014-03-28 16:50:31
536
原创 ural 1019 Line Painting
http://acm.timus.ru/problem.aspx?space=1&num=1019#include #include #include #define maxn 200100using namespace std;struct node{ int r,l,co;}tree[maxn*4];int co[maxn],l[maxn],r[maxn];
2014-03-26 19:03:32
383
原创 hdu 1754 I Hate It
http://acm.hdu.edu.cn/showproblem.php?pid=1754这道题就是一道水题,求区间内的最大值。#include #include #include #define maxn 300000using namespace std;int a[maxn];int max2;struct node{ int l,r,max1;}tre
2014-03-06 19:58:01
383
原创 HDU 1166 敌兵布阵
http://acm.hdu.edu.cn/showproblem.php?pid=1166#include #include #include #define maxn 50010using namespace std;int a[maxn];struct node{ int l,r; int sum;}tree[maxn*4];void build(i
2014-03-03 19:02:08
381
原创 poj 3277 Mountains
http://poj.org/problem?id=3227这道题题意就是求登山远望,看到山表面的长度。通过比较点所在直线的斜率来判断线段是不是可以被看到。#include #include #include #include #define maxn 2000using namespace std;int n,h;const double eps=1e-8;int cm
2014-02-28 20:12:51
442
原创 poj 3130 How I Mathematician Wonder What You Are!
http://poj.org/problem?id=3130这道题和poj 3335基本上一样,就是输入顺序不一样,这个是逆时针。这道题就是求多边形是不是有核,用半平面交求。半平面交定义:对于任何平面,任何直线都能将平面划分成两部分,即两个半平面。半平面交既是多个半平面的交集。#include #include #include #include #define maxn 10
2014-02-24 14:42:37
466
原创 poj 1066 Treasure Hunt
http://poj.org/problem?id=1066这道直接暴力枚举每个分割的小线段的中点,然后与宝藏的那个点相连,然后判断与此线段相交的线段数,求出最小就行。#include #include #include #include #include #define maxn 500000using namespace std;const double eps=1e-
2014-02-22 19:20:08
431
原创 poj 1151 Atlantis
http://poj.org/problem?id=1151这道题就是给你一些矩形的左上角和右下角的坐标,这些矩形可能有重叠,求这些矩形覆盖的面积。先把x坐标和y坐标分别离散化。然后再求面积。#include #include #include #define maxn 510using namespace std;int n;double x2,y2,x1,y1;bo
2014-02-20 21:20:23
573
原创 poj 2352 Stars
http://poj.org/problem?id=2352题意:给你一些y递增(y相等,x递增)的坐标,按照在一个点的左方并且在下方(包括垂直方向的)的点的个数划分等级,求1到n-1的等级的个数。#include #include #define maxn 400000using namespace std;int c[maxn],leve[maxn],a,b,n;int
2014-02-20 15:40:49
453
原创 poj 2892 Tunnel Warfare
http://poj.org/problem?id=2892这道题就是有一系列连续的村庄,然后有一些操作,包括对村庄破坏和修复、查询。就是求某个点所在最长连续区间。用线段树维护区间内左端点往右的最长连续区间的长度len和右端点往左的最长连续区间的长度ren。#include #include #include #define maxn 51000using namespace
2014-02-20 10:25:44
425
原创 poj3264 Balanced Lineup
http://poj.org/problem?id=3264这道题就是求一个区间的最大值与最小值的差,用的线段树做的。#include #include #include #define maxn 5001000using namespace std;int a[maxn],x,y,N,Q,ans,max1,min1;struct node{ int l;
2014-02-19 09:42:21
372
原创 poj 3308 Paratroopers
http://poj.org/problem?id=3308#include #include #include #include #include #define maxn 10000using namespace std;const int inf=1<<30;int n,m,l,x,y;double c,f;double cap[200][200],flow[200
2014-02-18 14:36:23
378
原创 poj 3114 Countries in War
http://poj.org/problem?id=3114这道题和poj 3592 一样,先缩点再spfa求最短路#include #include #include #include #define maxn 300000using namespace std;const int inf=1<<30;int head[maxn],head1[maxn],dfn[maxn
2014-02-18 08:22:51
413
原创 poj 3592 Instantaneous Transference
http://poj.org/problem?id=3592这道题先有tarjan算法缩点,然后再建图,再有spfa算法求最长路。#include #include #include #include #define maxn 300000using namespace std;const int inf=-1<<30;int e,head[maxn],belong[max
2014-02-16 17:20:53
406
原创 poj 2186 Popular Cows
http://poj.org/problem?id=2186题意:N头奶牛,给出若干欢迎关系a,b,表示a欢迎b,欢迎关系是单向的,但也是可以传递的,另外每个奶牛都是欢迎他自己的。求出被所有奶牛欢迎的奶牛的数目。#include #include #include #include #include #define maxn 100001using namespace st
2014-02-13 19:49:38
445
原创 poj 3694 Network
http://poj.org/problem?id=3694tarjan算法的应用,数组开的要大,还有新加的边。#include #include #include #define maxn 201105using namespace std;int e,low[maxn],dfn[maxn],dfs_clock,f[maxn],num,b[maxn],n,m,head[max
2014-02-12 21:14:26
503
原创 poj 1195 Mobile phones
http://poj.org/problem?id=1195#include #include #include #define maxn 1026using namespace std;int a[maxn][maxn];int c[maxn][maxn];int S,x,y,aa,l,r,b,t,h,T;int lowbit(int x){ return x&
2014-02-11 16:24:46
409
原创 poj 2886 Who Gets the Most Candies?
http://poj.org/problem?id=2886题意: N个孩子顺时针坐成一个圆圈且从1到N编号,每个孩子手中有一张标有非零整数的卡片。第K个孩子先出圈,如果他手中卡片上的数字A大于零,下一个出圈的是他左手边第A个孩子。否则,下一个出圈的是他右手边第(-A)个孩子。第p个出圈的孩子会得到F(p)个糖果,F(p)为p的因子数。求得到糖果数最多的是哪个孩子及得到多少糖
2014-02-11 10:51:11
417
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人