自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(179)
  • 问答 (1)

原创 HDU 5956 The Elder(树上斜率优化DP)

The ElderTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1098 Accepted Submission(s): 289Problem Description Once upon a time, in the mysti

2017-11-28 22:01:10 451

原创 HDU 5952 Counting Cliques(无向图定向搜索)

Counting CliquesTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 3480 Accepted Submission(s): 1254Problem Description A clique is a complete

2017-11-21 21:37:11 333

原创 ZOJ 3981 Balloon Robot(提前位置取消等待时间)

Balloon Robot Time Limit: 1 Second Memory Limit: 65536 KB The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be teams participating in the contest, and the con

2017-10-30 12:21:10 713

原创 HDU 5936 Difference(折半枚举)

DifferenceTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1247 Accepted Submission(s): 335Problem Description Little Ruins is playing a num

2017-10-28 15:49:42 428

原创 51Nod 1110 距离之和最小 V3(中位数+权值转化为个数)

基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 X轴上有N个点,每个点除了包括一个位置数据X[i],还包括一个权值W[i]。点P到点P[i]的带权距离 = 实际距离 * P[i]的权值。求X轴上一点使它到这N个点的带权距离之和最小,输出这个最小的带权距离之和。 Input 第1行:点的数量N。(2 <= N <= 10000) 第2 - N + 1行:每行

2017-10-25 17:57:19 291

原创 Codeforces 274D Lovely Matrix(拓扑排序+建图)

D. Lovely Matrix time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Lenny had an n × m matrix of positive integers. He loved the matrix so mu

2017-10-25 16:30:57 452

原创 Codeforces 873B Balanced Substring(利用前缀和找和为0的子串)

B. Balanced Substring time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given a string s consisting only of characters 0 and 1. A sub

2017-10-18 15:02:24 290

原创 HDU 5917 Instability(Ramsey定理)

InstabilityTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 592 Accepted Submission(s): 218Problem Description Long long ago, there was a pr

2017-10-17 09:41:48 347

原创 51Nod 1499 图(最小割+边在割的一边有收益建图)

1499 图 基准时间限制:2 秒 空间限制:262144 KB 分值: 80 难度:5级算法题 给一个无向图,你要将这些点分成A、B两个集合,使得满足A的导出子图是一个完全图,而B的导出子图是一个没有边的图。 但是事实上你不一定能够做到,所以你允许有错误。我们定义一个完美值为: 1.如果A中两点有边相连,则增加|i-j|的完美值。 2.如果B中两点无边相连,则增加|i-j|的完美值。

2017-10-15 13:16:16 299

原创 Codeforces 808F Card Game(和是素数二分图建图+二分图带权最大独立集)

F. Card Game time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Digital collectible card games have become very popular recently. So Vova dec

2017-10-13 12:04:42 321

原创 Codeforces 808E Selling Souvenirs(花费是倍数关系的背包)

E. Selling Souvenirs time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output After several latest reforms many tourists are planning to visit Berl

2017-10-13 09:36:07 376

原创 HihoCoder 1252 Kejin Game(最小割+点在割的一侧有花费建图)

Nowadays a lot of Kejin games (the games which are free to get and play, but some items or characters are unavailable unless you pay for it) appeared. For example, Love Live, Kankore, Puzzle & Dragon,

2017-10-08 20:16:09 381

原创 Codeforces 804D Expected diameter of a tree(树的直径)

F. Expected diameter of a tree time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Pasha is a good student and one of MoJaK’s best friends. He

2017-10-07 23:16:16 288

原创 Codeforces 813D Two Melodies(维护转移来源的DP)

D. Two Melodies time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Alice is a beginner composer and now she is ready to create another master

2017-10-05 14:32:53 418

原创 Codeforces 864F Cities Excursions(离线处理+Tarjan)

F. Cities Excursions time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are n cities in Berland. Some pairs of them are connected with

2017-10-01 22:57:52 556

原创 HDU 5556 Land of Farms(枚举+二分图匹配)

Land of FarmsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 526 Accepted Submission(s): 174 Problem Description Farmer John and his broth

2017-10-01 16:22:16 237

原创 POJ 3728 The merchant(LCA+DP)

The merchant Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 5160 Accepted: 1776 DescriptionThere are N cities in a country, and there is one and only one simple path between eac

2017-09-18 15:09:09 414

原创 HDU 6196 happy happy happy(卡时剪枝)

happy happy happyTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 299 Accepted Submission(s): 86Problem Description Today, Bob plays with a

2017-09-12 15:56:57 370

原创 POJ 1991 Turning in Homework(由大推小的区间DP)

Turning in Homework Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 1172 Accepted: 519 DescriptionBessie must turn in her homework for her C classes (1 <= C <= 1,000) at Moo U so

2017-09-09 21:15:55 473

原创 2017乌鲁木齐赛区网络赛 I Colored Graph(完全图边定向构造)

I: Colored Graph time limit 1000ms memory limit 131072KB In graph theory, graph colouring is a special case of graph labelling. It is an assignment of labels traditionally called colours to edges

2017-09-09 18:26:32 1234

原创 Codeforces 818F Level Generation(三分)

F. Level Generation time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Ivan is developing his own computer game. Now he tries to create some l

2017-09-08 15:11:13 529

原创 BZOJ 2597 [Wc2007]剪刀石头布(凸费用流问题)

2597: [Wc2007]剪刀石头布Time Limit: 20 Sec Memory Limit: 128 MBSec Special Judge Submit: 1464 Solved: 663 [Submit][Status][Discuss] Description在一些一对一游戏的比赛(如下棋、乒乓球和羽毛球的单打)中,我们经常会遇到A胜过B,B胜过C而C又胜过A的有趣情况,

2017-09-07 18:55:04 400

原创 POJ 3680 Intervals(区间覆盖建图)

Intervals Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 8549 Accepted: 3641 DescriptionYou are given N weighted open intervals. The ith interval covers (ai, bi) and weighs wi.

2017-09-07 14:40:43 351

原创 Codeforces 846E Chemistry in Berland(防爆long long)

E. Chemistry in Berland time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Igor is a post-graduate student of chemistry faculty in Berland St

2017-09-07 10:28:04 335

原创 Codeforces 846D Monitor(二维前缀和)

D. Monitor time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Luba bought a monitor. Monitor is a rectangular matrix of size n × m.

2017-09-06 21:16:27 651

原创 洛谷OJ 1155 双栈排序(二分图染色)

题目描述Tom最近在研究一个有趣的排序问题。如图所示,通过2个栈S1和S2,Tom希望借助以下4种操作实现将输入序列升序排序。操作a如果输入序列不为空,将第一个元素压入栈S1操作b如果栈S1不为空,将S1栈顶元素弹出至输出序列操作c如果输入序列不为空,将第一个元素压入栈S2操作d如果栈S2不为空,将S2栈顶元素弹出至输出序列如果一个1~n的排列P可以通过一系列操作使得输出序列为1,2,…,(n-1)

2017-09-06 16:50:44 349 1

原创 51Nod 1693 水群(打表确定转移范围优化)

1693 水群 基准时间限制:0.4 秒 空间限制:524288 KB 分值: 160 难度:6级算法题 收藏 关注 总所周知,水群是一件很浪费时间的事,但是其实在水群这件事中,也可以找到一些有意思的东西。 比如现在,bx2k就在研究怎样水表情的问题。 首先,bx2k在对话框中输入了一个表情,接下来,他可以进行三种操作。 第一种,是全选复制,把所有表情全选然后复制到剪贴板中。 第二种,

2017-09-06 14:23:51 334

原创 HDU 2454 Degree Sequence of Graph G(Heavel定理)

Degree Sequence of Graph GTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2717 Accepted Submission(s): 1168Problem Description Wang Haiyang

2017-09-06 09:47:42 767

原创 HDU 6187 Destroy Walls(对偶图最小生成树)

Destroy WallsTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 236 Accepted Submission(s): 96Problem Description Long times ago, there are

2017-09-06 08:58:06 987 1

原创 HDU 6184 Counting Stars(无向图三元环计数)

Counting StarsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 459 Accepted Submission(s): 115Problem Description Little A is an astronomy l

2017-09-05 20:49:24 1412 1

原创 HITOJ 2739 The Chinese Postman Problem(有向带权图上的中国邮递员问题)

The Chinese Postman Problem Source : bin3 Time limit : 1 sec Memory limit : 64 M Submitted : 530, Accepted : 177 A Chinese postman is assigned to a small town in China to deliver letters. In t

2017-09-05 08:58:52 451

原创 最小度限制生成树

定义  在一张无向带权图中,找出一棵生成树,使得某个特定结点的度数不超过KK或者恰好等于KK的,并且权值和最小。求解算法  首先我们对不与特殊结点相连的边求最小生成树,得到几个连通分量。然后找出每个连通分量到特殊结点的最短的边,把这条边添加到生成树中,这样我们就得到了一个度限制为连通分量数的最小生成树。如果有连通分量到特殊结点没有边,则说明无法构成生成树。如果连通分量数大于KK,则说明无法在度数限制

2017-09-03 09:09:27 511

原创 HDU 4899 Hero meet devil(DP套DP)

Hero meet devilTime Limit: 16000/8000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 692    Accepted Submission(s): 338Problem DescriptionThere is

2017-09-01 11:08:30 380

原创 Codeforces 839E Mother of Dragons(最大团)

E. Mother of Dragonstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n castles in the Lannister's

2017-08-31 19:52:54 450

原创 Codeforces 842C Ilya And The Tree(树上DP+因子个数估计)

C. Ilya And The Tree time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Ilya is very fond of graphs, especially trees. During his last trip t

2017-08-30 11:05:57 1103 4

原创 ZOJ 3424 Rescue(和式变形递推公式降低复杂度)

Rescue Time Limit: 3 Seconds Memory Limit: 65536 KB The princess is trapped in a magic place. In this place, there are N magic stones. In order to rescue the princess, you should destroy all the

2017-08-29 19:46:01 429

原创 POJ 3463 Sightseeing(最短路次短路计数)

SightseeingTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 9444 Accepted: 3319DescriptionTour operator Your Personal Holiday organises guided bus trip

2017-08-28 19:58:21 322

原创 Codeforces 845G Shortest Path Problem?(异或最短路)

G. Shortest Path Problem?time limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given an undirected graph

2017-08-28 14:05:31 1717 3

原创 POJ 2449 Remmarguts' Date(K短路)

Remmarguts' DateTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 30907 Accepted: 8438Description"Good man never makes girls wait or breaks an appointme

2017-08-27 15:15:43 256

原创 HDU 6166 Senior Pan(二进制划分集合)

Senior PanTime Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 166    Accepted Submission(s): 39Problem DescriptionSenior Pan fail

2017-08-22 20:26:36 679

空空如也

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