自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

kalilili的专栏

岁月如歌

  • 博客(23)
  • 收藏
  • 关注

原创 Codeforces GYM 100651 D I Conduit! (水计算几何)

大致题意: 1e3 个线段,画在一张纸上,求可以看成多少个线段,( 两个线段部分重叠,或收尾相接将看成一个线段)思路:在同一一条直线上的两条线段: 他们斜率相等,他们在Y轴或X轴上的投影点相等。然后根据这两个排下序就可以搞出来了。这题卡精度,要用到eps//#pragma comment(linker, "/STACK:1024000000,1024

2015-08-31 22:26:06 792

原创 51nod 1378 夹克老爷的愤怒(树形DP+贪心)

题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1378大致题意:一棵1e5节点的树,安放某些位置,一个位置可以控制距他的距离不超过K的所有节点, 输入树和K,求控制全图(所有节点)需要安放最少的个数思路:假如是线性结构,一定是从边界开始每距离2k安放一个,然后最后正好或者再放置一个,这个

2015-08-30 10:57:23 1423

原创 Codeforces Round #315 (Div. 1) C. New Language(2-sat+贪心)(好题)

大致题意:a~z每个字符分辅音和元音C和V,给出构词的法则,(pos1,kind1,pos2,kind2)如果位置1是kind1类型的字符,那么位置2必须是kind2类型的字符,求字典序不小于某个给定字符的合法构词(长度和给定的字符相等)若不存在输出-1长度n思路:可以贪心枚举每一位,假设前pos位答案和给定字符相等,那么pos+1位的字符必须比给定的字符pos+1位的字符

2015-08-21 12:05:49 1130

原创 HDU 5402 Travelling Salesman Problem (构造)(好题)

大致题意:n*m的非负数矩阵,从(1,1) 只能向四面走,一直走到(n,m)为终点,路径的权就是数的和,输出一条权值最大的路径方案思路:由于这是非负数,要是有负数就是神题了,要是n,m中有一个是奇数,显然可以遍历,要是有一个偶数,可以画图发现,把图染成二分图后,(1,1)为黑色,总能有一种构造方式可以只绕过任何一个白色的点,然后再遍历其他点,而绕过黑色的点必然还要绕过两个白色点才能遍历

2015-08-21 11:50:35 692

原创 Codeforces Round #152 (Div. 2) D. Sweets for Everyone!(二分)

大致题意:有一些商店和一些居民在一排上,某人要从起点开始对所有居民发放1kg糖果,每个商店可以可以且仅可以买一次1kg糖果,每向前或向后走以单位需要1时间单位,求在t时间内发完所以的居民最少需要自身带多少kg糖果思路:这种题,明显就是二分,二分答案,然后从边界开始判可行,这题的可行还是有点难判,首先糖果手中充足,遇到一个居民就发放1kg,当糖果不充足的时候,只能有两种决策,直接跑到尽头

2015-08-21 11:35:21 776

原创 UVA 12486 Space Elevator(数位DP)

题目pdf:http://acm.bnu.edu.cn/v3/external/124/12486.pdf大致题意:求第n个不包含"4"和"13"为子串的数是多少 , n思路:就是一般的数位DP,二分答案,对答案的数求数位DP算出此数以内有多少个满足条件的数但是....居然答案爆long long,要用unsigned long long 才能过,就这个坑点//

2015-08-15 01:09:02 1113

原创 UVA 12487 Midnight Cowboy(LCA+大YY)(好题)

题目pdf:http://acm.bnu.edu.cn/v3/external/124/12487.pdf大致题意:一棵树,一个人从A节点出发,等可能的选任何一条边走,有两个节点B,C求这个人先到达B的概率思路:先说结论:只和A的距离有关,先到达B+先到达A的概率 = 1,然后根据距离分配一下就好。构造性证明:如果B-A-C在一条链上显然就是按距离分配概率,因为链上的支

2015-08-15 00:58:53 1109

原创 UVA 12493 Stars (欧拉函数--求1~n与n互质的个数)

https://uva.onlinejudge.org/index.phpoption=com_onlinejudge&Itemid=8&category=279&page=show_problem&problem=3937题目:http://acm.bnu.edu.cn/v3/external/124/12493.pdf大致题意:圆上有偶数n个点,每间隔m个点连起来,最后可以把所

2015-08-15 00:19:02 1374

原创 Codeforces Round #315 (Div. 1) B. Symmetric and Transitive(Bell数的应用)(好题)

B. Symmetric and Transitivetime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Johnny has recently le

2015-08-12 21:31:04 1255 1

原创 HDU 5365 Run(大水题)

大致题意:8*8的整点格子,输入16个整点,求多少种点的集合可以组成正3,正4,5,6边形思路:sb题啊...整点格子组成不了n !=4的所有正多边形,只要判是否能组成正方形就可以了这里有个优美的无穷递降的证明:http://www.zhihu.com/question/25304120而我是枚举所有点的集合判断是否能组成正多边形的蠢方法= =,先用凸包对点排个序,

2015-08-09 23:58:47 626

原创 Codeforces Round #295 (Div. 1) B. Cubes(最大最小堆+拓扑模拟)

B. Cubestime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce Vasya and Petya assembled a figure of m cubes

2015-08-09 23:26:37 999

原创 Uva 11383 Golden Tiger Claw(KM算法原理应用)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2378大致题意:500*500带权格子,每行每列要确定一个值,使row[i]+col[j] >= val[i][j],要使所有row值和col值的和最小输出每行的row[i],和每列的col[i

2015-08-09 23:14:28 766

原创 LA4043 - Ants(二分图完备最佳匹配KM)

https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2044大致题意:平面上有n个白点和n个黑点,求一种完美匹配使他们间的连线不相交思路:要注意到,若有两种匹配相交,总可以当成对角线补成四边形,然后选四边形的两个边作为匹配就不会相

2015-08-09 21:51:29 1027

原创 Topcoder SRM 663 Div2 Hard: CheeseRolling(状压DP)

Problem Statement  N people (where N is a power of 2) are taking part in a single-elimination tournament in cheese rolling. The diagram below illustrates the structure of the tournament br

2015-08-08 17:16:17 953

原创 Codeforces Round #Pi (Div. 2) E. President and Roads(边双无向图缩点(有重边)+最短路)

E. President and Roadstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBerland has n cities, the capital is

2015-08-08 10:16:10 971

原创 Codeforces Round #250 (Div. 1) B. The Child and Zoo(排序+并查集)(常规好题)

B. The Child and Zootime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOf course our child likes walking in a

2015-08-05 23:55:04 933

原创 URAL 1907. Coffee and Buns(数论推导+容斥原理)

1907. Coffee and BunsTime limit: 1.0 secondMemory limit: 64 MBPlanet Ataraxia is known for its education centers. The people who are expected to take high social positions in future are

2015-08-05 23:33:28 780

原创 Codeforces Round #250 (Div. 1) D. The Child and Sequence(线段树暴力)

D. The Child and Sequencetime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAt the children's day, the child

2015-08-05 23:24:01 1234

原创 Codeforces Round #249 (Div. 2) D. Special Grid (递推乱搞)(好题)

time limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an n × m grid, some of its nodes are black, the ot

2015-08-05 23:05:03 864

原创 URAL 1900. Brainwashing Device(dp+输出路径)

1900. Brainwashing DeviceTime limit: 1.0 secondMemory limit: 64 MBWhile some people travel in space from planet to planet and discover new worlds, the others who live on Earth still have

2015-08-03 17:42:20 908

原创 HDU 5340 Three Palindromes( 折半枚举+Manacher+记录区间 )

Three PalindromesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 809    Accepted Submission(s): 240Problem DescriptionCan we divided

2015-08-02 20:16:54 831 2

原创 SRM 664 Div2 Hard: BearSortsDiv2(归并排序)

Problem Statement Bear Limak was chilling in the forest when he suddenly found a computer program. The program was a correct implementation of MergeSort. Below you can find the program in

2015-08-02 20:02:44 537

原创 HDU Untitled(状压DP OR dfs枚举子集)

UntitledTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 325    Accepted Submission(s): 169Problem DescriptionThere is an integer

2015-08-01 23:50:23 862

空空如也

空空如也

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

TA关注的人

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