自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

LucienShui

www.lucien.ink

  • 博客(44)
  • 资源 (2)
  • 收藏
  • 关注

原创 Codeforces 842C - Ilya And The Tree - 树形DP或DFS

链接:  http://codeforces.com/contest/842/problem/C题目:Ilya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very interesting tree rooted at vertex 1. There is an i

2017-08-31 00:55:16 669

原创 Codeforces 844B - Rectangles - 思维

链接:  http://codeforces.com/contest/844/problem/B题目:You are given n × m table. Each cell of the table is colored white or black. Find the number of non-empty sets of cells such that:All cells in a set h

2017-08-31 00:40:45 800

原创 POJ 1617 - Phone List - 字典树

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=1671题目:Problem DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the

2017-08-31 00:29:44 300

原创 UPCOJ 4198 - Birthday present - 暴力

链接:  http://exam.upc.edu.cn/problem.php?id=4198题目:题目描述Bob’s father’s birthday is coming,.Because Bob’s father is a math teacher so that Bob wanted to give him an array of positive intergers a of length

2017-08-31 00:26:15 344

原创 UPCOJ 4199 - Coach's plan - 二分图匹配 + 二分答案

链接:  http://exam.upc.edu.cn/problem.php?id=4199题目:题目描述NEUACM team holds summer training every year. This year n students participate in the training, and we provide m computers. Everyone has a suitabi

2017-08-31 00:18:55 440 1

原创 UPCOJ 4201 - Teacher’s Day - 二分贪心

链接:  http://exam.upc.edu.cn/problem.php?id=4201题目:题目描述Teacher’s Day is coming, a group of n students decided to buy gifts. The store offered them M gifts. The price is different for different gifts, b

2017-08-31 00:06:41 331

原创 UPCOJ 4333 - Covering - 矩阵快速幂

链接:  http://exam.upc.edu.cn/problem.php?id=4333题目:题目描述Bob’s school has a big playground, boys and girls always play games here after school. To protect boys and girls from getting hurt when playing ha

2017-08-30 23:58:45 1119

原创 「模板」 随机遍历数组

#include <iostream>#include <cstdlib> // srand rand#include <ctime> // time#include <algorithm>using namespace std;/** * 随机遍历数组 */void Traverse_Random(int arr[], int n){ srand(time(NUL

2017-08-19 23:51:05 1003

原创 「模板」 归并排序

void mergearray(int a[], int first, int mid, int last, int temp[]){ int i = first, j = mid + 1; int m = mid, n = last; int k = 0; while (i <= m && j <= n) { if (a[i] <= a[j])

2017-08-19 23:49:38 192

原创 「模板」 左偏树 - 实现可并优先队列

template<typename T, typename _Compare=std::less<T> >class leftist_tree {private: struct node { T data; int deep; node *l, *r; node(const T &d) : data(d), deep(1),

2017-08-19 23:47:35 499

原创 Double Queue - POJ 3481 - 树堆Treap的数组实现

链接:  题目:DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern infor

2017-08-19 23:27:24 440

原创 Black Box - POJ 1442 - Treap

链接:  http://poj.org/problem?id=1442题目:DescriptionOur Black Box represents a primitive database. It can save an integer array and has a special i variable. At the initial moment Black Box is empty and i

2017-08-19 22:57:38 413

原创 Shaolin - HDU 4585 - 树堆

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=4585题目:Problem DescriptionShaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there

2017-08-19 21:21:34 540

原创 非诚勿扰 - HDU 4557 - Treap入门

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=4557题目:Problem Description  作为2013年699万应届毕业生中的一员,由于宏观经济的不景气,小明在毕业当天就华丽丽地失业了!   经历了千难万苦的求职过程,小明特别能理解毕业生的就业之难,所以,他现在准备创建一家专门针对IT人才的求职中介公司——非诚勿扰人力资源开发有限公司。

2017-08-19 21:15:50 460

原创 [模板] 树堆 - Treap的指针和数组实现及一些例题

指针版:template <class T, class Compare = std::less<T> >class Treap {private: struct treap {//成员结构体 int size, fix;//以当前节点为根的树的节点数目,和调整树结构的fix随机数 T key;//每个节点的权,可以定义成自己想要的类型 C

2017-08-19 21:11:15 658

原创 [模板] 二叉堆 - 优先队列的二叉堆数组实现

最近开始学数据结构,一直无心更新博客,今天结束集训,晚上打算码一下最近的进度。/* * 创建一个最大容量为MaxSize的int型堆:MaxHeap<int> que(MaxSize); * 默认最大容量为1007:MaxHeap<int> que; * * 作为优先队列: * pop(); 同优先队列pop(),如果队列已为空还要执行pop,就会执行死循环以报错。

2017-08-19 20:53:37 431

转载 图论500题!

转自:Enstein_Jun=============================以下是最小生成树+并查集======================================【HDU】1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A

2017-08-11 15:14:26 494

原创 Ants - HDU 3565 - 二分图KM - 详解

链接:  http://poj.org/problem?id=3565题目:DescriptionYoung naturalist Bill studies ants in school. His ants feed on plant-louses that live on apple trees. Each ant colony needs its own apple tree to feed i

2017-08-10 23:27:51 429

原创 奔小康赚大钱 - HDU 2255 - 二分图匹配

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=2255题目:Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。 这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且

2017-08-10 23:12:17 263

原创 The Accomodation of Students - HDU 2444 - 二分图匹配

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=2444题目:Problem DescriptionThere are a group of students. Some of them may know each other, while others don’t. For example, A and B know each other, B and

2017-08-10 23:07:08 318

原创 [模板] + [详解] - 二分图最大匹配 - 匈牙利算法

讲解:  别人的博客传送门,图做的真的很棒:传送门模板: 成员:const int maxn = 207;int n,m;//n个点,m条边bool col[maxn];//对点进行染色bool vis[maxn];//标记点int link[maxn];//将两点进行连接vector<int> edge[maxn];//邻接表void addedge (int u, int v) {//

2017-08-10 22:59:11 388

原创 [模板] + [详解] - 二分图 - KM算法

讲解参考:  我就不再贴一遍了,直接传送门吧:传送门模板:  加了一些自己的理解。成员:int love[maxn][maxn],n;//love[i][j]表示第i个女生对第j个男生的好感度int ex_girl[maxn];//第i个女生的当前期望值为ex_girl[i]int ex_boy[maxn];//同上bool vis_girl[maxn];//标记在当前配对过程中girl[i]

2017-08-10 22:43:06 492 2

转载 [离散数学]偏序与全序的区别、解释

转自:https://github.com/liuchuo概念:偏序关系、全序关系都是公理集合论中的一种二元关系。 偏序集合:配备了偏序关系的集合。 全序集合:配备了全序关系的集合。偏序:集合内只有部分元素之间在这个关系下是可以比较的。 比如:比如复数集中并不是所有的数都可以比较大小,那么“大小”就是复数集的一个偏序关系。全序:集合内任何一对元素在在这个关系下都是相互可比较的。 比如:有限长

2017-08-08 17:41:01 24347 1

原创 Network - UVA 315 - 无向图求割点

链接:  https://cn.vjudge.net/problem/UVA-315题目:DescriptionA Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N

2017-08-07 17:48:41 293

原创 Matrix Power Series - POJ 3233 - 矩阵快速幂

链接:  http://poj.org/problem?id=3233题目:DescriptionGiven a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.InputThe input contains exactly one test case. The first line of

2017-08-06 15:53:28 328 2

原创 Power Network - POJ 1459 - 网络流

链接:  http://poj.org/problem?id=1459题目:DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amoun

2017-08-06 15:41:12 296

原创 Network of Schools - POJ 1236 - 强连通分量

链接:  http://poj.org/problem?id=1236题目:DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to

2017-08-06 15:30:52 282

原创 233 Matrix - HDU 5015 - 矩阵快速幂

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=5015题目:Problem DescriptionIn our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 … in the same meaning. A

2017-08-06 15:16:08 338

原创 Kiki & Little Kiki 2 - HDU 2276 - 矩阵快速幂

链接:  题目:Problem Description There are n lights in a circle numbered from 1 to n. The left of light 1 is light n, and the left of light k (1< k<= n) is the light k-1.At time of 0, some of them turn on,

2017-08-06 14:57:28 409

原创 Drainage Ditches - HDU 1532 - 网络流

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=1532题目:Problem Description Every time it rains on Farmer John’s fields, a pond forms over Bessie’s favorite clover patch. This means that the clover is c

2017-08-06 14:47:08 298

原创 How far away? - HDU 2586 - LCA

链接:  http://acm.hdu.edu.cn/showproblem.php?pid=2586题目:Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “

2017-08-06 14:41:28 250

原创 Nearest Common Ancestors - POJ 1330 - LCA

链接:  http://poj.org/problem?id=1330题目:DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an

2017-08-06 14:29:24 221

原创 [模板] - LCA倍增

成员:const int maxn = 1007;int up[maxn][32];//倍增数组int depth[maxn];//每个点在树中的深度int n,m;//n个点,m条边bool vis[maxn];vector<int> tree[maxn];//邻接表函数:DFS记录深度和初始化倍增数组://记录各节点i的深度depth[i],dfs一遍即可O(N)void dfs(i

2017-08-06 14:18:49 336 1

原创 [模板] - 读入挂 读入优化

我的读入挂:int read() { int x = 0; char c = getchar(); while (c &lt; '0' || c &gt; '9')c = getchar(); while (c &gt;= '0' &amp;&amp; c &lt;= '9') { x = x * 10 + c - '0'; c = getchar(); }

2017-08-06 14:02:49 4366 7

原创 [模板] - 网络流 - Dinic & 当前弧优化

函数:邻接表部分:const int INF = 0x3f3f3f3f, maxn = 157;int N, NP, NC, M;struct E { int u, v, flow; E(int u = 0, int v = 0, int flow = 0): u(u), v(v), flow(flow) {}} edg[maxn * maxn];int cnt_edg, S,

2017-08-03 17:40:04 3853 5

原创 [模板] - 网络流 - Dinic

数据成员:const int maxn = 207, INF = 0x3f3f3f3f;int n, m, mp[maxn][maxn];//邻接矩阵int que[maxn*maxn], head, tail;//BFS队列 ,首,尾int dist[maxn];//距源点距离,分层图 int ans;函数:BFS查询是否连通:bool bfs() { memset(dist,-1

2017-08-02 23:09:12 271

原创 [模板] - 矩阵快速幂

说明:  所有可能用到的操作已经被封装进结构体里了。用的时候根据题目再修改一下即可。实现:const int maxn = 107;int Matrixsize = 2, mod = int(1e9)+7;struct Matrix { int m[maxn][maxn]; Matrix(int i = 0) { memset(m, 0, sizeof m);

2017-08-01 20:42:36 262

原创 Fibonacci - POJ 3070 - 矩阵快速幂

链接:  http://poj.org/problem?id=3070题目:DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are:0,

2017-08-01 20:38:54 313

原创 Cow Navigation - UPCOJ 3427 - 六维BFS

链接:  http://exam.upc.edu.cn/problem.php?id=3427题目:题目描述Bessie has gotten herself stuck on the wrong side of Farmer John’s barn again, and since her vision is so poor, she needs your help navigating acro

2017-08-01 17:08:28 410

原创 聊斋 - UPCOJ 3560 - 枚举 暴力

链接:  http://exam.upc.edu.cn/problem.php?id=3560题目:题目描述某人读完《聊斋志异》,编出这样一道题。题目为:现有男鬼(b)、女鬼(r)、小鬼(w)共n人(n<400),围站成一环(小鬼可以算是男的也可以算是女的)。从某人开始分别在两边数连续相同性别数(两边的性别可不同),直到第一次发现不同性别为止。当前数的这个人至少要同左右两边中的一方具有相同性别,并算

2017-08-01 17:02:29 597

鲁大师单文件版

鲁大师单文件版,只能用于查看电脑配置,其它功能一律阉割

2019-01-06

完全卸载小娜(Cortana)

此工具可以完全卸载小娜,卸载小娜之后可以减少Windows对系统磁盘的索引与爬取,减少系统负担和磁盘负担。

2018-12-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除