闷声发大财.看明年之前闷HowMuch
文章平均质量分 77
ruclion
天上一日,地下十年
展开
-
ASC45 Analogous Sets
题目描述:Problem A. Analogous Sets Input le: analogous.in Output le: analogous.out Time limit: 2 seconds Memory limit: 512 mebibytes For a set A of positive integers let us call A + A a multiset {x原创 2015-11-28 19:36:11 · 442 阅读 · 0 评论 -
camp day6
A题.题意:给出一个环,就是0到2^30,0和2^30的点是重合的,然后告诉你1e5个随机的点, 现在给出一个k, k<=n, 要求你挑k个位置,使得:对于每个给出的点,都有一个距离它最近的我们给出的点,距离是L,对于每一个点,取L的max,然后让这个 max值最小的分配k个点的方案,不用输出方案,输出最小的Lmax就行 题解:二分Lmax, 然后对于给出的每一个,都有一个最远控制它的大哥,大哥都原创 2016-01-30 23:08:32 · 318 阅读 · 0 评论 -
camp day4
A题.题意:给出n~200个点,然后给出m < n - 2个逆时针的图形,要求n个点的分布满足:这些个图形的边都是水平的和垂直的. 如果不是水平和垂直的,需要加一个点,然后变成水平和垂直的.每加一个点就多用一个代价.问加点个数最少的加点的个数. 题解:带下界的费用流,点向图形流4个,因为每个都是90度,然后图形与图形之间有一个公共边,那么就连一个费用为一的,流为INF的流,然后图形向终点连2*n-原创 2016-01-29 11:40:01 · 309 阅读 · 0 评论 -
camp day3
D题。题意:给出n个数的序列,n~2000,每个数都有一个权值,w,wi + wj 》d的话,i和j有一条边。 题目中会给出d的值~1e9. 问将这些分成两个集合,使得这两个集合之间的边最多,问最多的条数,和最多条数时候的方案数。 题解:我们先只算最多的条数。关键是理解d的限制建造出的边的使用方法。我们看 ,将w升序排序,那么前面的会有一些和n点没有建边的,可以丢掉,然后有一些只和n建边的,之后重原创 2016-01-27 23:15:14 · 333 阅读 · 0 评论 -
camp day2
C题:3种不同颜色的机器人,每种都有大于1000个,在1000*1000的格子上,分布是给出的,问每个都走m步之后,每种颜色机器人都走到了同一个格子,不同颜色的终点要求不同,问有多少种不同的走法. 题解:首先我们考虑容斥, 单独考虑每一种机器人,然后直接相乘,但是有相同的,我们再减去a b一样,c不一样, 以及ac bc 然后加上abc. 现在要做的就是1000左右个点,要求走到一个点的方案数原创 2016-01-26 23:53:10 · 316 阅读 · 0 评论 -
camp day1
B.题,题意:2000个点的很多边的图,求所有最短路ij的长度平方的和. 题解:平方的和,我们没什么小技巧了. 只能求出来每个ij的长度. 那么我们枚举i为起点,来更新所有的j,但是是边的复杂度,太大了,我们发现其实只要更新f[j],一次,bfs的时候先更新到的就能删了,下次不用考虑.但是这道题重点是:用bitset来做,因为还有一个点连得边和当前没有更新的集合,取个&,然后关键是很快找到那些为一原创 2016-01-25 23:21:04 · 364 阅读 · 0 评论 -
Codeforces Round #326 (Div. 1) C. Duff in the Army
题目描述:C. Duff in the Army time limit per test4 seconds memory limit per test512 megabytes inputstandard input outputstandard output Recently Duff has been a soldier in the army. Malek is her comman原创 2015-12-06 11:41:22 · 600 阅读 · 0 评论 -
CF334 div1 D :Ruminations on Ruminants
题目描述:D. Ruminations on Ruminants time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output Kevin Sun is ruminating on the origin of cows while stand原创 2015-12-06 11:21:09 · 588 阅读 · 0 评论 -
2015 Asia - Jakarta D - An ICPC Problem without Statement
题目描述:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=104601#problem/D题解:1.当一定大于等于0的时候,就是我们尽量凑2的时候,我们放2,-2,1, -1, 0的顺序,每次能放就放最多的,和-1的 dfs深搜. 2.当必须是-的时候,要么全部必须要选,要么全是负数(可以推一下) 所以就是绝对值小的.重点:1.负数的时候原创 2016-01-24 22:56:55 · 297 阅读 · 0 评论 -
2015-2016 ACM ICPC Baltic Selection Contest C Minimax Tree
题目描述:http://codeforces.com/gym/100796/problem/C题解:很好的一道题目. 正着做是树形dp,显然n太大. 我们习惯性的反着考虑,看一个值能不能成为最小值. 那么最小的那个只需要到根的距离的min就能够保证(1). 那次小的呢?就是在和比它大的汇合的时候一定要取一次min, 那么我们搞lca,在这里取min一定是最好的. 那么发现(1)也不准确了,原创 2016-01-19 21:53:25 · 347 阅读 · 0 评论 -
UVALive 7345 J - The Hypnotic Spirals
题目描述:Professor Parinita Pratim Das, a brilliant Mathematician of this era, dreams of winning the Fields Medal someday for her patented Spirals that are custom made to hypnotize Engineers. To show t原创 2016-01-19 10:42:56 · 626 阅读 · 0 评论 -
UVALive 7344 I - Numbered Cards
题目描述:You have N cards and each has an unique number between 1 and N written on it. In how many ways can you select a non-empty subset of the cards such that the number written on any two of your sele原创 2016-01-19 10:36:12 · 719 阅读 · 0 评论 -
UVALive 7343 H - Design New Capital
题目描述:If you go through history you will come across many fun facts about the capital city of a country. In many countries the most famous or most populated or most industrialized cities are not declar原创 2016-01-19 10:31:11 · 873 阅读 · 0 评论 -
UVALive 7338 C - Toll Management IV
题目描述: Another attempt of revising toll system is rejected by the people of Byteland. The Government is in big trouble now. They are seeking help of Hashmat, the brave warrior and the great programmer o原创 2016-01-19 10:27:11 · 689 阅读 · 0 评论 -
Kabbalah for Two
题目描述:Problem K. Kabbalah for Two Input le: kabbalah.in Output le: kabbalah.out Time limit: 5 seconds Memory limit: 512 mebibytes Kai and Kevin are kabbalists. However, they don’t like traditiona原创 2015-11-28 20:00:35 · 263 阅读 · 0 评论 -
camp day7
A题.题意:给出一个矩阵,每次可以用两个向量的乘积搞一个一样矩阵,加到上面,初始是全是0的矩阵,给出了目标矩阵,问最少做这样的次数,每次的两个向量都可以随便不同的定. 题解:就是求矩阵的zhi,类似于高斯消元,注意mod一个大质数或者用long double C题.题意:有一些点,每个点上有一个射线,有一个角度,可以照射到这个角度范围内的,是一个探照灯,然后保证所有的角度并起来不会达到360,问原创 2016-01-31 23:28:13 · 356 阅读 · 0 评论