自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

深海沧澜的博客

不存在十全十美的文章,如同不存在彻头彻尾的绝望。

  • 博客(31)
  • 资源 (1)
  • 收藏
  • 关注

原创 2018年全国多校算法寒假训练营练习比赛(第五场) A 逆序数 树状数组 离散化

题目描述 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。比如一个序列为4 5 1 3 2, 那么这个序列的逆序数为7,逆序对分别为(4, 1), (4, 3), (4, 2), (5, 1), (5, 3), (5, 2),(3, 2)。输入描述:第一行有一个整数n(1 <= n <=...

2018-02-26 09:37:11 203

原创 2018年全国多校算法寒假训练营练习比赛(第五场) C 字符串的问题 KMP算法(判断是否是前缀和后缀)

题目描述 有一个字符串 让你找到这个字符串 S 里面的子串T 这个子串 T 必须满足即使这个串的前缀 也是这个串的后缀 并且 在字符串中也出现过一次的(提示 要求满足前后缀的同时也要在字符串中出现一次 只是前后缀可不行 输出最长满足要求字符串)输入描述:给出一个字符串 长度 1 到 1e6  全部是小写字母输出描述:如果找的到就输出这个子串T 如果不行就输出 Just a legend示例1输入f...

2018-02-26 09:32:44 247 2

原创 2018年全国多校算法寒假训练营练习比赛(第五场) G 送分啦-QAQ HDU 2516 斐波拉底博弈

题目描述     幼儿园开学了,为了让小盆友们能尽可能的多的享受假期。校长大人决定让小盆友分批到校,至于每批学生来多少人由一个小傻子和一个小仙女负责,两个人轮番负责,校长会在最后的时候去查看工作进度,小傻子不想被别人嘲笑自己傻,小仙女要证明自己比小傻子聪明。所以她们回去争抢安排最后一名小盆友。每次安排的小盆友至少为1,至多为上一次安排的2倍。小仙女抢到了先手的机会。第一次安排小盆友不能直接安排所有...

2018-02-26 09:28:57 302

原创 大二 上 生活总结

 大二上学期注定对我来说是一个比大一更丰富的时期。7.8月在ACM实验室里面集训,因为个人实力没有获得进入省赛的资格,并认识了一些学弟学妹,没有想到事情会发展到后面的样子。9月的时候身为副部,协助部长完成招新和宣传的工作,并最后完成了5名委员的招纳,其中有2位委员是我暑假认识的学弟,并于9月份和2位队友打了6场区域赛的网络赛,来年再战。10月国庆节朋友叫我去桂林旅游,但因为学生会副部以上人员要查军...

2018-02-26 09:23:39 1540

原创 HDU - 1541 Stars 树状数组 单点更新(求比当前数字大的数字有多少个)

Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and ...

2018-02-25 11:59:58 272

原创 HDU 1394 Minimum Inversion Number 树状数组 单点更新

The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a given sequence of numbers a1, a2, ..., an, if we move the fi...

2018-02-25 10:48:45 220

原创 POJ 1308 Is It A Tree? 并查集 (判断任意2个点是否有且仅有一条路径可以相通)

A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties. There i...

2018-02-19 10:46:20 225

原创 POJ 1703 Find them, Catch them 并查集 (关系问题 判断是否在一个集合)

DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to ident...

2018-02-19 10:38:29 310

原创 HDU 1272 小希的迷宫 并查集 (判断任意2个点是否有且仅有一条路径可以相通)

Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希...

2018-02-18 11:42:32 377

原创 HDU 1233 还是畅通工程 并查集 (单向点连通)

Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行...

2018-02-18 11:37:43 319

原创 HDU 1232 畅通工程 并查集模板题目

Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?  Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;...

2018-02-18 11:33:45 209

原创 POJ 1182 食物链 并查集 (关系问题)

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有...

2018-02-14 12:38:55 232

原创 AtCoder Beginner Contest 087 D - People on a Line 并查集(区间和问题)

Problem StatementThere are N people standing on the x-axis. Let the coordinate of Person i be xi. For every i, xi is an integer between 0 and 109 (inclusive). It is possible that more than one person ...

2018-02-14 11:56:55 364

原创 HDU 3038 How Many Answers Are Wrong 并查集 (判断区间值是否正确)

 TT and FF are ... friends. Uh... very very good friends -________-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should ...

2018-02-14 11:17:18 322

原创 HDU 1213 How Many Tables 并查集 (统计树的个数)

Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a...

2018-02-13 12:52:49 224

原创 线段树总结

本文采用cyh大佬的线段树pdf线段树是一种二叉树,适用于区间/线段的有关操作,如修改,插入,查询等,线段树的二分结构的可以高效的完成上述操作,时间复杂度lgn。1.基本性质2.单点更新,区间查询附上模板:#define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 //lson rson分别表示左...

2018-02-13 09:50:50 213

原创 HDU 4027 Can you answer these queries? 线段树 区间更新(优化)

A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of end...

2018-02-09 11:18:54 202

原创 POJ 3264 Balanced Lineup 区间查询(两棵树求最大最小值)

For 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. To keep things ...

2018-02-09 11:14:11 661

原创 PS各项具体功能实现

1.网上制作证件照和大头贴视频:https://www.imooc.com/video/23142.图片的裁剪视频:https://www.imooc.com/video/23173.图片的选区 抠图 覆盖  CTRL + C  复制选区     CTRL+ V   粘贴选区    CTRL + T   调整选区大小视频 :https://www.imooc.com/video/2421     ...

2018-02-08 18:09:18 793

原创 PS学习之路问题

1.ps打开照片提示“无法完成请求,因为程序错误”https://jingyan.baidu.com/album/c85b7a6443a991003bac950a.html?picindex=6

2018-02-08 16:40:03 193

原创 POJ 2528 Mayor's poster 线段树离散化

 DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council h...

2018-02-08 11:03:59 209

原创 ZOI 1610 Count the Colors 线段树区间更新 (求相同值的段)

Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last.InputTh...

2018-02-08 11:01:01 235

原创 POJ 3468 A Simple Problem with Integers 线段树区间更新 (lazy策略 值在基础上相加或相减)

DescriptionYou have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ...

2018-02-08 09:37:47 215

原创 HDU 1698 Just a Hook 线段树区间更新(值进行覆盖)

 In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. Now Pudge w...

2018-02-08 09:36:57 202

原创 HDU 1754 B I Hate It 线段树 单点更新 区间最大值 模板

很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0学生ID编号分别从1编到N。 第二

2018-02-07 10:21:04 181

原创 HDU 1394 Minimum Inversion Number (线段树的单点更新)

The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj. For a given sequence of numbers a1, a2, ..., an, if we move the first m >= 0 n

2018-02-06 16:05:23 109

原创 HDU 1166 敌兵布阵 (线段树单点更新 区间查询)

C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局要研究敌人究竟演习什么战术,所...

2018-02-06 15:53:31 219

原创 HDU 2844 Coins 多重背包 (重量和价值相同)

Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a

2018-02-02 12:11:28 403

原创 fill 与memset 给整个数组赋值

1.fill()函数包含在头文件中。原型为    template    void fill(ForwardIterator first, ForwardIterator last, const T& value);      其中first与last分别代表迭代器的起始与终止,而value即为要赋的值因此可以通过其对数组元素进行统一赋值操作,而省去了for循环的麻烦,注意赋值区间

2018-02-02 11:05:42 1059

原创 POJ - 3260 The Fewest Coins ( 多重背包 min 价值为1)

Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e., the number of coin

2018-02-02 10:53:38 261

原创 POJ 2392 Space Elevator ( 多重背包 背包限制不同 + 贪心 )

DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) different types of blocks with which

2018-02-01 00:11:10 424

虚拟机VM Virtual Box 下ubuntu 编译内核 与 简单的Hello Word模块的添加删除教程

虚拟机VM Virtual Box 下ubuntu 编译内核 与 简单的Hello Word模块的添加删除教程

2018-03-28

空空如也

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

TA关注的人

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