自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 收藏
  • 关注

原创 POJ - 2104 K-th Number (划分树)

K-th NumberYou are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able t...

2019-04-29 20:42:17 134

原创 LibreOJ #144. DFS 序 1 (线段树 | 树状数组 | zkw线段树)

题目描述这是一道模板题。给一棵有根树,这棵树由编号为1...N的N个结点组成。根结点的编号为R。每个结点都有一个权值,结点i的权值为Vi。接下来有组操作,操作分为两类:1 a x,表示将结点a的权值增加x; 2 a,表示求结点a的子树上所有结点的权值之和。输入第一行有三个整数N,M和R。第二行有N个整数,第i个整数表示Vi。在接下来的N-1行中,每行...

2019-04-29 11:27:13 619

原创 HRBUST - 2319 Number Game(贪心+DP | 贪心+优先队列)

Number GameTherearenitemsandtwoplayers,Kimandyou.Foreachplayerandforeachitem,thevalueoftheitemforthisplayerisknown.Denotevaluesofthei-thitemforthefirstandthesec...

2019-04-26 10:59:15 177

原创 SCU - 4439 Vertex Cover (二分图最小点覆盖 匈牙利算法)

Vertex Coverfrog has a graph withnnverticesv(1),v(2),…,v(n)v(1),v(2),…,v(n)andmmedges(v(a1),v(b1)),(v(a2),v(b2)),…,(v(am),v(bm))(v(a1),v(b1)),(v(a2),v(b2)),…,(v(am),v(bm)).She would like to...

2019-04-24 17:04:51 182

原创 HDU-2063 过山车 (二分图匹配,匈牙利模板)

过山车RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或LL做partner,PrincessSnow愿意和水域浪子或伪酷儿做partn...

2019-04-24 16:32:40 109

原创 SCU - 4438 Censor (KMP)

Censorfrog is now a editor to censor so-called sensitive words (敏感词).She has a long textpp. Her job is relatively simple -- just to find the first occurence of sensitive wordwwand remove it.f...

2019-04-24 14:52:59 9552

原创 SCU - 4437 Carries (思维+二分)

Carriesfrog hasnnintegersa1,a2,…,ana1,a2,…,an, and she wants to add them pairwise.Unfortunately, frog is somehow afraid of carries (进位). She defineshardnessh(x,y)h(x,y)for addingxxandyyth...

2019-04-24 14:41:51 140

原创 HDU - 1686 Oulipo (字符串Hash)

OulipoThe 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 normal, mai...

2019-04-24 10:26:54 202

原创 士兵杀敌(三) (RMQ | zkw线段树)

士兵杀敌(三)题目描述:南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。所以,南将军经常问军师小工第i号士兵到第j号士兵中,杀敌数最高的人与杀敌数最低的人之间军功差值是多少。现在,请你写一个程序,帮小工回答南将...

2019-04-23 10:59:00 125

原创 POJ-2769 Feel Good (单调栈)

Feel Good题目链接:http://poj.org/problem?id=2796DescriptionBill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days i...

2019-04-22 16:56:17 108

原创 ZOJ - 3732 Graph Reconstruction (Havel_Hakimi定理 )

Graph Reconstruction题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3732Let there be a simple graph withNvertices but we just know the degree of each vertex. Is it possible to...

2019-04-22 11:17:09 190

原创 POJ - 2559 Largest Rectangle in a Histogram (单调栈)

Largest Rectangle in a HistogramA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For exam...

2019-04-19 14:20:43 126

原创 HDU-1087 Super Jumping! Jumping! Jumping! (最大上升子序列)

Super Jumping! Jumping! Jumping!Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I i...

2019-04-19 10:01:22 222

原创 HDU-1069 Monkey and Banana (贪心+DP)

Monkey and Banana题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1069A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a buildin...

2019-04-19 09:40:08 208

原创 HDU-1029 Ignatius and the Princess IV

Ignatius and the Princess IV"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N integers. There will be a special i...

2019-04-19 09:00:16 100

原创 HDU-1024 Max Sum Plus Plus (DP m子段的最大和)

Max Sum Plus Plus题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1024Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more di...

2019-04-19 08:54:07 124

原创 HDU - 5543 Pick The Sticks(01背包)

Pick The SticksThe story happened long long ago. One day, Cao Cao made a special order called "Chicken Rib" to his army. No one got his point and all became very panic. However, Cao Cao himself fel...

2019-04-17 11:09:09 244

原创 HDU - 5542 The Battle of Chibi (DP + 离散化+树状数组)

The Battle of ChibiCao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought the only way to beat Cao Cao is to have a spy in Cao Cao's army....

2019-04-17 10:41:18 162

原创 ZOJ - 3689 Digging (背包+贪心)

DiggingWhen it comes to theMaya Civilization, we can quickly remind of a term called the end of the world. It's not difficult to understand why we choose to believe the prophecy (or we just assume...

2019-04-10 19:54:27 180

原创 HDU - 6082 度度熊与邪恶大魔王 (完全背包)

度度熊与邪恶大魔王题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6082度度熊为了拯救可爱的公主,于是与邪恶大魔王战斗起来。邪恶大魔王的麾下有n个怪兽,每个怪兽有a[i]的生命值,以及b[i]的防御力。度度熊一共拥有m种攻击方式,第i种攻击方式,需要消耗k[i]的晶石,造成p[i]点伤害。当然,如果度度熊使用第i个技能打在第j个怪...

2019-04-09 19:43:36 144

原创 ZOJ - 3939 The Lucky Week (规律)

The Lucky Week题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3939Edward, the headmaster of the Marjar University, is very busy every day and always forgets the date.There was ...

2019-04-09 10:58:09 127

原创 CodeForces - 939E Maximize!(尺取)

Maximize!题目链接:http://codeforces.com/problemset/problem/939/EYou are given a multisetSconsisting of positive integers (initially empty). There are two kind of queries:Add a positive integer to...

2019-04-08 21:27:51 297

原创 HDU - 3117 Fibonacci Numbers (矩阵快速幂 + 斐波那契通项公式)

Fibonacci Numbers题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3117The Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, exc...

2019-04-08 20:31:05 478

原创 POJ - 1149 PIGS (最大流 Dinic)

PIGS题目链接:http://poj.org/problem?id=1149Mirko works on a pig farm that consists of M locked pig-houses and Mirko can't unlock any pighouse because he doesn't have the keys. Customers come to the fa...

2019-04-08 17:28:46 150

原创 CodeForces - 950C Zebras (模拟)

ZebrasOleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days azebra, if it starts with a bad day, ends with a bad...

2019-04-08 16:15:36 147

原创 CodeForces - 813C The Tag Game (BFS)

The Tag Game 题目链接:http://codeforces.com/problemset/problem/813/CAlice got tired of playing the tag game by the usual rules so she offered Bob a little modification to it. Now the game should be ...

2019-04-08 13:01:58 196

原创 POJ - 2823 Sliding Window (滑动窗口 单调队列模板题)

Sliding Window题目链接:https://vjudge.net/problem/POJ-2823An array of sizen≤ 106is given to you. There is a sliding window of sizekwhich is moving from the very left of the array to the very rig...

2019-04-05 15:39:02 601

原创 CodeForces - 832B Petya and Exam (模拟)

Petya and ExamIt's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he thinks he lacks time to finish them all, so he asks you to help ...

2019-04-05 09:32:50 203

原创 HDU - 3038 How Many Answers Are Wrong (带权并查集)

How Many Answers Are Wrong题目链接:https://vjudge.net/problem/HDU-3038TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following...

2019-04-04 10:15:31 106

原创 POJ - 1062 昂贵的聘礼 (最短路 spfa)

昂贵的聘礼题目链接:https://vjudge.net/problem/POJ-1062年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就...

2019-04-03 21:08:06 140

原创 POJ - 3159 Candies (差分约束 + spfa)

Candies题目链接:https://vjudge.net/problem/POJ-3159During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag ...

2019-04-03 20:51:27 134

原创 CodeForces - 405B Domino Effect (模拟)

Domino Effect题目链接:http://codeforces.com/problemset/problem/405/BLittle Chris knows there's no fun in playing dominoes, he thinks it's too random and doesn't require skill. Instead, he decided to p...

2019-04-03 10:29:00 232

原创 FZU - 1924 死锁 (拓扑排序)

死锁在操作系统中存在着死锁问题。进程在执行过程中,因争夺资源而造成的一种互相等待的现象,若无外力作用,它们都将无法推进下去。此时称系统处于死锁状态或系统产生了死锁,这些永远在互相等待的进程称为死锁进程。由于资源占用是互斥的,当某个进程提出申请资源后,使得有关进程在无外力协助下,永远分配不到必需的资源而无法继续运行,这就产生了死锁。例如,如果线程A占用了资源1并等待资源2,而线程B占...

2019-04-03 09:30:10 436

原创 CodeForces - 203B Game on Paper

Game on PaperOne not particularly beautiful evening Valera got very bored. To amuse himself a little bit, he found the following game.He took a checkered white square piece of paper, consisting of...

2019-04-02 15:59:21 188

原创 CodeForces - 1051C Vasya and Multisets

Vasya and Multisets万圣节到了,杰哥准备给班级里的同学发糖吃,男生女生各一堆。于是他去腐败街的xx小卖部买糖,他认为糖只要是独一无二的那他就是好糖,他跟老板说他想要买n个不一样的糖,但是老板是个黑心商贩,当杰哥把糖带回去的时候才发现有挺多相同的糖而杰哥是一个公平正直的人,他希望男生女生两堆糖中好糖的数量相同,于是他想找你帮忙来解决他的烦恼。为了简化问题我们将不同的糖用不用...

2019-04-02 15:48:02 124

原创 CodeForces - 474A Keyboard (水题)

Keyboard题目链接 :http://codeforces.com/problemset/problem/474/AOur good friend Mole is trying to code a big message. He is typing on an unusual keyboard with characters arranged in following way:...

2019-04-02 15:37:45 878

空空如也

空空如也

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

TA关注的人

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