- 博客(16)
- 资源 (15)
- 问答 (1)
- 收藏
- 关注
原创 HDU1823(线段树)
Problem Description世界上上最远的距离不是相隔天涯海角而是我在你面前可你却不知道我爱你 ―― 张小娴前段日子,枫冰叶子给Wiskey做了个征婚启事,聘礼达到500万哦,天哪,可是天文数字了啊,不知多少MM蜂拥而至,顿时万人空巷,连扫地的大妈都来凑热闹来了。―_―|||由于人数太多,Wiskey实在忙不过来,就把统计的事
2016-04-30 19:56:14 430
原创 poj 3264RMQ
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows.
2016-04-30 07:49:40 413
原创 poj 1952buy low, buy lower
The advice to "buy low" is half the formula to success in the bovine stock market.To be considered a great investor you must also follow this problems' advice: "Buy low; buy lowe
2016-04-24 12:54:09 423
原创 String HDU5672
Problem DescriptionThere is a string S.S only contain lower case English character.(10≤length(S)≤1,000,000)How many substrings there are that contain at least k(1≤k≤26) distinct characters?
2016-04-24 07:39:37 465
原创 LightOj1303
As we all know that not only children but Ferris-Wheel (FW) is favorite to all ages. That's why the LightOJ Park has made a special FW for the programmers. And unlike other Ferris-Wheels, this FW has
2016-04-22 14:45:32 621
原创 康托定理
把一个大数拆成许多个位数,然后将这些个位数重新组合,使其形成一个新的数字,将这些数按从小到大排列,求第多少个数是多少?例1 {1,2,3,4,5}的全排列,并且已经从小到大排序完毕(1)找出第96个数首先用96-1得到95用95去除4! 得到3余23有3个数比它小的数是4所以第一位是4用23去除3! 得到3余5有3个数比它小的数是
2016-04-20 10:16:56 4438
原创 poj3461 Oulipo(KMP)
DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair nor
2016-04-19 22:40:54 567
原创 poj1157Little Shop of Flowers(动态规划题)
DescriptionYou want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row.
2016-04-18 19:25:59 369
原创 魏佐夫博弈HDU1527
#include#includeusing namespace std;int main(){ int n,m,k; while(cin>>n>>m) { if(n<m) { int c=n; n=m; m=c; }
2016-04-17 22:02:49 305
原创 树的最小支配集和最大独立集
树的最小支配集: 注意这里只是实现部分,要如何使用要根据题目而变。const inf=999999999;int dp[250][3]; //0表示选中此点的父亲,1表示选中此点,2表示选中此点的儿子vectorvec[250]; //这个保存下标i是父亲结点,vec[i]向量保存儿子结点void MDS_DP(int u,int fa){ dp[
2016-04-17 11:14:08 1659 2
原创 HDU1358 Period(KMP)
Problem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string.
2016-04-16 14:11:16 467
原创 动态规划用法归纳
在实际应用中,展示动态规划的用法。 01背包问题#include#includeusing namespace std;int val[5000];int wei[5000];int f[13000];inline int max(int a,int b){ return a>b?a:b;}int main(){ memset(f,0,size
2016-04-08 17:50:08 443
原创 线段树用法归纳
基本的创建线段树和查找一段区间内最小值。#include#include#includeusing namespace std;int A[1000300];int M[1000300];//构建线段树,目的:得到M数组.void build(int node, int b, int e){ if (b == e) M[node] = b; //只有一个元素,只有一个下
2016-04-05 23:04:02 441
转载 ACM学习路线
组队的事情我不多谈,我着重从个人的角度来说两句。主要分成两部分:1. 理论部分初学阶段要做的就是熟悉语言基础;熟悉基本数据结构和常见简单算法。这些内容,书本里都有。推荐的书籍,《算法导论》。至于语言入门书太多了,不列举。进阶阶段,看一下圈内的论文,学习进阶的算法和数据结构,比如变种的平衡树SBT;比如线性的素数筛法,中国剩余定理;比如dinic,预留推进,最高顶标;亦或者是快速的半
2016-04-02 22:17:54 6203 1
原创 冗余关系
题目大意:n个语句,m个人。好友关系具有传递性,问有多少语句是多余的?#include using namespace std;int fa[2000];// 还记得之前阅读课里讲的并查集算法// father函数返回的是节点x的祖先节点int father(int x) { if (fa[x] != x) fa[x] = father(fa[x]); retu
2016-04-01 19:56:20 651
原创 快排
#include #include using namespace std;void quick_sort(int dat[], int l, int r) { // 首先请填写下面三个变量的初值 int i = l, j =r , mid =dat[r] ; do { while (dat[i] < mid) ++i; while (
2016-04-01 13:00:22 277
JDK9.0.1安装包
2017-10-29
mysql操作练习的表数据
2017-03-17
EcFun综合娱乐网站
2016-12-12
农贸产品项目javaee实现
2016-11-07
数字验证码
2016-11-07
图书馆管理系统
2016-09-11
2048网页版游戏
2016-08-10
用java做出聊天工具
2016-06-26
偏向锁 ,synchronized相关的
2018-01-28
TA创建的收藏夹 TA关注的收藏夹
TA关注的人