![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
2019暑假集训
向阳花木0829
搬去博客园啦,https://www.cnblogs.com/0xiaoyu/
展开
-
敌兵布阵(线段树)
C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战术,所以...原创 2019-07-29 10:21:24 · 121 阅读 · 0 评论 -
棋盘问题(DFS)
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n当为...原创 2019-07-26 19:25:08 · 102 阅读 · 0 评论 -
HDU 1495 非常可乐(BFS)
非常可乐大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,1...原创 2019-07-27 09:33:53 · 84 阅读 · 0 评论 -
迷宫问题(BFS)
迷宫问题定义一个二维数组:int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,...原创 2019-07-27 10:37:52 · 184 阅读 · 0 评论 -
Birthday Puzzle(异或+子集)
Birthday PuzzleToday is the Birthday of a beautiful girl, she’s happy and she’s telling her friends loudly to bring her birthday gifts. One of her best friends who is fond of puzzles decided to bring...原创 2019-07-27 10:41:21 · 172 阅读 · 0 评论 -
Tickets(思维+预处理)
Last nn days Monocarp used public transport to get to the university. He received a ticket with number titi during the ii-th day.Tickets’ numbers are six digit non-negative integers with possible lea...原创 2019-08-01 14:51:42 · 420 阅读 · 0 评论 -
Color the ball(分块)
N个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数ab(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a,b(1 ...原创 2019-08-01 17:19:16 · 142 阅读 · 0 评论 -
Fire!(BFS)
Joe works in a maze. Unfortunately, portions of the maze havecaught on fire, and the owner of the maze neglected to create a fireescape plan. Help Joe escape the maze.Given Joe’s location in the ma...原创 2019-07-28 14:54:45 · 260 阅读 · 1 评论 -
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 ...原创 2019-07-31 08:43:53 · 104 阅读 · 0 评论 -
sdut 3345 数据结构实验之二叉树六:哈夫曼编码
Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description字符的编码方式有多种,除了大家熟悉的ASCII编码,哈夫曼编码(Huffman Coding)也是一种编码方式,它是可变字长编码。该方法完全依据字符出现概率来构造出平均长度最短的编码,称之为最优编码。哈夫曼编码常被用于数据文件压缩中,其压缩率通常在20%~90%之间。你的...原创 2019-07-25 09:43:48 · 182 阅读 · 0 评论 -
A Simple Problem with Integers(线段树+区间更新)
You 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 ask for the su...原创 2019-07-30 16:43:06 · 92 阅读 · 0 评论 -
Group(分块+莫队)
There are n men ,every man has an ID(1…n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand in line. Now we select an interval of men to make ...原创 2020-05-17 17:17:51 · 201 阅读 · 0 评论 -
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 wa...原创 2019-07-30 20:44:53 · 82 阅读 · 0 评论 -
I Hate It(线段树+更新)
很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 )...原创 2019-07-30 21:23:17 · 150 阅读 · 0 评论 -
An Average Game(分块+莫队)
Alice and Bob has just learned how to find average of some numbers. They got really excited anddecided to come up with a game about finding average.The game works like this, at the start of game a s...原创 2019-08-03 15:15:25 · 173 阅读 · 0 评论 -
Super Mario(分块)
Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Mario needs to save his lover. We regard the road to...原创 2019-08-01 20:35:46 · 169 阅读 · 0 评论