
枚举
兔蠢蠢
这个作者很懒,什么都没留下…
展开
-
HDU 6127 Hard challenge(极角排序+枚举点)
Hard challengeTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 915 Accepted Submission(s): 372Problem DescriptionThere are n原创 2017-08-16 14:01:00 · 401 阅读 · 0 评论 -
2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 E.Half-consecutive Numbers
The numbers 1, 3, 6, 10, 15, 21, 28, 36, 45 and ti=12i(i+1)t_i=\frac{1}{2}i(i+1)are called half-consecutive.For given N, find the smallest r which is no smaller than N such that trt_r is square.Input F原创 2017-09-13 12:32:23 · 375 阅读 · 0 评论 -
HDU 6034 Balala Power! (位权排序)
Balala Power!Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 6884 Accepted Submission(s): 1705Problem DescriptionTalent原创 2017-12-08 11:42:32 · 223 阅读 · 0 评论 -
NEFU 1321 差点是素数 (二分优化)
NEFU 1321差点是素数 Problem:1321Time Limit:1000msMemory Limit:65535KDescription 统计两个区间[l1,r1],[l2,r2]的整数中有多少个数满足:它本身不是素数,但只有一个素因子。当x两个区间都符合时,答案只算一次 Input 一共t组数据 t每组数据l1,r1,l2,r2 (1Output 输出满原创 2018-02-01 14:45:38 · 243 阅读 · 0 评论 -
HDU 4311 Meeting point-1(曼哈顿距离优化枚举)
HDU4311题意给你n个点,再n个点中找一个点,这个点到其他点的曼哈顿距离之和最小思路首先说一下曼哈顿距离 |x−xi|+|y−yi|" role="presentation" style="text-align: center; position: relative;">|x−xi|+|y−yi||x−xi|+|y−yi|\left | x-x_{原创 2018-01-29 13:24:19 · 644 阅读 · 0 评论 -
HDU 4312 Meeting point-2(切比雪夫距离转换为曼哈顿距离优化枚举)
HDU 4312题意给你n个点求其中一个点到其他点max(|x−xi|,|y−yi)" role="presentation" style="position: relative;">max(|x−xi|,|y−yi)max(|x−xi|,|y−yi)max(|x−x_{i}|,|y−y_{i})之和的最小值思路max(|x−xi|,|y&原创 2018-01-29 14:30:28 · 293 阅读 · 0 评论 -
洛谷 P1157 组合的输出(二进制枚举子集)
P1157 题目描述排列与组合是常用的数学方法,其中组合就是从 nn 个元素中抽出 rr 个元素(不分顺序且 r \le n)r≤n) ,我们可以简单地将 nn 个元素理解为自然数 1,2,…,n1,2,…,n ,从中任取 rr 个数。现要求你不用递归的方法输出所有组合。例如 n=5,r=3n=5,r=3 ,所有组合为:12 3 , 1 2 4 , 1 2 5 , 1 3 4 ,...原创 2018-08-01 21:14:00 · 703 阅读 · 0 评论