- 博客(53)
- 收藏
- 关注
原创 codeforces 601E. A Museum Robbery
维护三种操作1、加入一个重量为w,价值为v的物品2、删除第k个加入的物品3、求背包容量分别为1到m时可以获得的的最大价值其中3用求和公式算出一个答案输出这题我们可以考虑cdq分治当做到区间[l,r]的时候,我们把所有起始位置r的物品加入背包这样不断迭代到某个区间[l,l]的时候就可以直接查询答案了维护哪些可以加入我是暴力传递vector的。这里可以用线段树来
2016-08-28 00:32:25 845
原创 Codeforces Round #368 (Div. 2) A,B,C,D
这场多灾多难啊。。fst了交错程序了删了stdio.h结果重装cpp什么的各种惨A. Brain's Photos出现C M Y中的任意一个就是彩色,否则黑白B. Bakery很容易得到答案肯定是一条边的长度枚举边,找一端是仓库一端不是的,取最小值即可C. Pythagorean Triples可以分n奇偶直接构造偶数:n^2-1,n^2+1奇数:n^2/2,n
2016-08-21 14:30:58 323
原创 2016多校训练Contest10: 1003 Captain is coding hdu5859
Problem DescriptionTo improve players’ coding skill, FJ collects a variety of problems and order the players to solve them. In order to ensure they can complete the task, FJ divides the problems i
2016-08-19 19:06:56 499
原创 2016多校训练Contest10: 1004 Death Sequence hdu5860
Problem DescriptionYou may heard of the Joseph Problem, the story comes from a Jewish historian living in 1st century. He and his 40 comrade soldiers were trapped in a cave, the exit of which was
2016-08-19 14:08:07 528
原创 2016多校训练Contest10: 1001 Median hdu5857
Problem DescriptionThere is a sorted sequence A of length n. Give you m queries, each one contains four integers, l1, r1, l2, r2. You should use the elements A[l1], A[l1+1] ... A[r1-1], A[r1] and
2016-08-18 23:22:56 491
原创 2016多校训练Contest10: 1011 Water problem hdu5867
Problem DescriptionIf the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3+3+5+4+4=19 letters used in total.If all the numbers from 1 to n (up to one thousand
2016-08-18 23:07:02 383
原创 2016多校训练Contest10: 1007 cjj's string game hdu5863
Problem Descriptioncjj has k kinds of characters the number of which are infinite. He wants to build two strings with the characters. The lengths of the strings are both equal to n. cjj also d
2016-08-18 23:04:58 624
原创 2016多校训练Contest10: 1006 Counting Intersections hdu5862
Problem DescriptionGiven some segments which are paralleled to the coordinate axis. You need to count the number of their intersection.The input data guarantee that no two segments share the s
2016-08-18 22:46:50 340
原创 2016多校训练Contest10: 1005 Road hdu5861
Problem DescriptionThere are n villages along a high way, and divided the high way into n-1 segments. Each segment would charge a certain amount of money for being open for one day, and you can op
2016-08-18 22:43:55 476
原创 2016多校训练Contest10: 1002 Hard problem hdu5858
Problem Descriptioncjj is fun with math problem. One day he found a Olympic Mathematics problem for primary school students. It is too difficult for cjj. Can you solve it?Give you the side l
2016-08-18 22:41:26 412
原创 莫队算法小介绍——看似暴力的莫队算法
摘要: 莫队算法是一个对于区间、树或其他结构离线(在线)维护的算法,此算法基于一些基本算法,例如暴力维护,树状数组,分块,最小曼哈顿距离生成树,对其进行揉合从而产生的一个简单易懂且短小好写的算法。此算法在很多情况下可以很轻松的切掉一些复杂而且难写的数据结构问题。关键词:程序设计、算法、算法优化,暴力算法,分块算法,最小曼哈顿距离生成树。背景: 众所周知,
2016-08-17 23:30:44 7199 2
原创 2016多校训练Contest9: 1002 Best Division hdu5845
Problem DescriptionYou are given an array A, consisting of N integers.You are also given 2 integers K and L.You must divide the whole array A into exactly K nonempty intervals, such that t
2016-08-17 00:22:44 927 4
原创 2016多校训练Contest9: 1012 Less Time, More profit hdu5855
Problem DescriptionThe city planners plan to build N plants in the city which has M shops.Each shop needs products from some plants to make profit of proi units.Building ith plant needs in
2016-08-17 00:16:38 550
原创 2016中国大学生程序设计竞赛 - 网络选拔赛 1008 Special Tetrahedron hdu5839
Problem DescriptionGiven n points which are in three-dimensional space(without repetition).Please find out how many distinct Special Tetrahedron among them. A tetrahedron is called Special T
2016-08-15 21:34:07 511
原创 bzoj 2669: [cqoi2012]局部极小值
Description有一个n行m列的整数矩阵,其中1到nm之间的每个整数恰好出现一次。如果一个格子比所有相邻格子(相邻是指有公共边或公共顶点)都小,我们说这个格子是局部极小值。给出所有局部极小值的位置,你的任务是判断有多少个可能的矩阵。Input输入第一行包含两个整数n和m(1nmn行每行m个字符,其中“X”表示局部极小值,“.”表示非局部极小值。 Out
2016-08-15 17:42:17 592
原创 2016中国大学生程序设计竞赛 - 网络选拔赛 1007 Mountain hdu5838
Problem DescriptionZhu found a map which is a N∗M rectangular grid.Each cell has a height and there are no two cells which have the same height. But this map is too old to get the clear informat
2016-08-15 17:30:57 742
原创 2016中国大学生程序设计竞赛 - 网络选拔赛 1011 Lweb and String hdu5842
Problem DescriptionLweb has a string S.Oneday, he decided to transform this string to a new sequence. You need help him determine this transformation to get a sequence which has the longes
2016-08-14 23:06:48 421
原创 2016中国大学生程序设计竞赛 - 网络选拔赛 1004 Danganronpa hdu5835
Problem DescriptionChisa Yukizome works as a teacher in the school. She prepares many gifts, which consist of n kinds with a[i] quantities of each kind, for her students and wants to hold a cl
2016-08-14 23:05:13 501
原创 2016中国大学生程序设计竞赛 - 网络选拔赛 1003 Magic boy Bi Luo with his excited tree hdu5834
Problem DescriptionBi Luo is a magic boy, he also has a migic tree, the tree has N nodes , in each node , there is a treasure, it's value is V[i], and for each edge, there is a cost C[i], wh
2016-08-14 23:02:25 834
原创 2016中国大学生程序设计竞赛 - 网络选拔赛 1002 Zhu and 772002 hdu5833
Problem DescriptionZhu and 772002 are both good at math. One day, Zhu wants to test the ability of 772002, so he asks 772002 to solve a math problem. But 772002 has a appointment with his girl
2016-08-14 22:57:28 737
原创 2016中国大学生程序设计竞赛 - 网络选拔赛 1001 A water problem hdu5832
Problem DescriptionTwo planets named Haha and Xixi in the universe and they were created with the universe beginning.There is 73 days in Xixi a year and 137 days in Haha a year. Now yo
2016-08-14 22:52:49 563
原创 2016多校训练Contest8: 1003 color II hdu5823
Problem DescriptionYou are given an undirected graph with n vertices numbered 0 through n-1.Obviously, the vertices have 2^n - 1 non-empty subsets. For a non-empty subset S, we define a proper
2016-08-13 14:13:15 360
原创 2016多校训练Contest7: 1003 Colosseo hdu5811
Problem DescriptionMr. Chopsticks keeps N monsters, numbered from 1 to N. In order to train them, he holds N * (N - 1) / 2 competitions and asks the monsters to fight with each other. Any two mons
2016-08-12 23:56:34 405
原创 2016多校训练Contest8: 1008 Rikka with Sequence hdu5828
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Yuta has an array A with n numb
2016-08-12 21:02:41 400
原创 2016多校训练Contest8: 1006 physics hdu5826
Problem DescriptionThere are n balls on a smooth horizontal straight track. The track can be considered to be a number line. The balls can be considered to be particles with the same mass.At t
2016-08-12 16:06:14 308
原创 2016多校训练Contest8: 1011 Rikka with Parenthesis II hdu5831
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Correct parentheses sequences c
2016-08-12 15:59:24 642 2
原创 2016多校训练Contest8: 1001 Ball hdu5821
Problem DescriptionZZX has a sequence of boxes numbered 1,2,...,n. Each box can contain at most one ball.You are given the initial configuration of the balls. For 1≤i≤n, if the i-th box
2016-08-12 15:56:38 455
原创 2016多校训练Contest7: 1004 Distance hdu5812
Problem DescriptionIn number theory, a prime is a positive integer greater than 1 that has no positive divisors other than 1 and itself. The distance between two positive integers x and y, denoted
2016-08-10 23:49:32 364
原创 2016多校训练Contest7: 1012 Lights hdu5820
Problem DescriptionToday is April 1st, 2100. Now Guangzhou is a very very big city. Since the number of traffic accidents increased last month, the mayor asked Mr. Chopsticks to investigate the tr
2016-08-10 16:09:55 587
原创 2016多校训练Contest7: 1011 Knights hdu5819
Problem DescriptionAt the start of this game, there are N knights on a road of length N+1. The knights are numbered from 1 to N, and the ith knight stands i unit from the left end of the road.
2016-08-09 23:13:50 680
原创 2016多校训练Contest7: 1002 Hearthstone hdu5810
Problem DescriptionMr. Chopsticks is interested in random phenomena, and he conducts an experiment to study randomness. In the experiment, he throws n balls into m boxes in such a manner that each
2016-08-09 21:41:41 385
原创 2016多校训练Contest7: 1008 Hearthstone hdu5816
Problem DescriptionHearthstone is an online collectible card game from Blizzard Entertainment. Strategies and luck are the most important factors in this game. When you suffer a desperate situatio
2016-08-09 21:35:34 480
原创 2016多校训练Contest7: 1005 Elegant Construction hdu5813
Problem DescriptionBeing an ACMer requires knowledge in many fields, because problems in this contest may use physics, biology, and even musicology as background. And now in this problem, you are
2016-08-09 21:28:10 327
原创 2016多校训练Contest7: 1010 Joint Stacks hdu5818
Problem DescriptionA stack is a data structure in which all insertions and deletions of entries are made at one end, called the "top" of the stack. The last entry which is inserted is the first on
2016-08-09 21:20:57 388
原创 2016多校训练Contest6: 1011 Zhu’s Math Problem hdu5803
Problem DescriptionZhu is a powerful ACMer/OverWatcher, now a salt-fish comes to ask Zhu a difficult problem. Zhu thinks that problem is so easy, so he wants to know whether you can solve it?The
2016-08-07 15:45:12 651
原创 2016多校训练Contest6: 1007 This world need more Zhu hdu5799
Problem DescriptionAs we all know,Zhu is the most powerful man.He has the infinite power to protest the world.We need more men like Zhu!In Duoladuo,this place is like a tree.There are n points
2016-08-07 00:11:11 799
原创 2016多校训练Contest6: 1006 Stabilization hdu5798
Problem DescriptionThe instability of a array A with length N is defined as ∑N−1i=1(|A[i+1]−A[i]|). In order to stabilize a array, changing every element A[i] to (A[i] xor X) is allowed. What is
2016-08-06 15:03:44 541
原创 2016多校训练Contest6: 1001 A Boring Question hdu5793
Problem DescriptionThere are an equation.∑0≤k1,k2,⋯km≤n∏1⩽jm(kj+1kj)%1000000007=?We define that (kj+1kj)=kj+1!kj!(kj+1−kj)! . And (kj+1kj)=0 while kj+1kj.You have to get the answer for eac
2016-08-05 17:21:31 534
原创 2016多校训练Contest6: 1008 To My Girlfriend hdu5800
Problem DescriptionDear GuoI never forget the moment I met with you.You carefully asked me: "I have a very difficult problem. Can you teach me?".I replied with a smile, "of course"."I have n i
2016-08-05 17:02:36 463
原创 2016多校训练Contest6: 1003 A Simple Nim hdu5795
Problem DescriptionTwo players take turns picking candies from n heaps,the player who picks the last one will win the game.On each turn they can pick any number of candies which come from the same
2016-08-04 23:57:21 350
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人