码迷,mamicode.com
首页 >  
搜索关键字:sticks    ( 387个结果
Sticks(剪枝+BFS)
Problem Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return s ...
分类:其他好文   时间:2018-07-31 21:52:10    阅读次数:124
Magic Sticks
#include using namespace std; #define ull unsigned long long int main() { int T, r, c; scanf("%d", &T); while (T--) { scanf("%d %d", &r, &c); if (min(... ...
分类:其他好文   时间:2018-07-28 16:50:14    阅读次数:148
【Codeforces 258A】 Game With Sticks
【题目链接】 http://codeforces.com/contest/451/problem/A 【算法】 若n和m中的最小值是奇数,则先手胜,否则后手胜 【代码】 ...
分类:其他好文   时间:2018-07-11 21:55:54    阅读次数:186
POJ 2653--Pick-up sticks(判断线段相交)
Pick-up sticks Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 14568 Accepted: 5510 Description Stan has n sticks of various length. He thr ...
分类:其他好文   时间:2018-07-11 14:59:37    阅读次数:163
[bzoj2529][Poi2011]Sticks_贪心
Sticks bzoj-2529 Poi-2011 题目大意:给你n根木棒,每种木棒有长度和颜色,颜色共有k种,求满足条件的3根木棒使得这3根木棒颜色互不相同且可以围成三角形。 注释:$1\le n \le 10^6$,$1\le k\le 50$。 想法:我们这么想:假设当前木棍是满足题意的三根木 ...
分类:其他好文   时间:2018-07-07 23:56:51    阅读次数:176
【POJ 1011】 Sticks
【题目链接】 http://poj.org/problem?id=1011 【算法】 深搜剪枝 首先我们枚举木棍的长度i,那么就有s/i根木棍,其中s为木棍长度的总和,朴素的做法就是对每种长度进行搜索,然而这样是会超时的,考虑优化 : 优化1 : 优化搜索顺序,将这些木棍的长度从大到小排序,搜索时按 ...
分类:其他好文   时间:2018-07-03 16:44:49    阅读次数:162
C - Ilya and Sticks
Problem description In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of n sticks ...
分类:其他好文   时间:2018-06-08 22:05:20    阅读次数:163
poj 1011 Sticks(经典DFS+剪枝)
题意:给出n根小棒的长度stick[i],已知这n根小棒原本由若干根长度相同的长木棒(原棒)分解而来。求出原棒的最小可能长度。 先说先具体的实现:求出总长度sum和小棒最长的长度max,则原棒可能的长度必在max~sum之间,然后从小到大枚举max~sum之间能被sum整除的长度len,用dfs求出 ...
分类:其他好文   时间:2018-05-18 20:05:51    阅读次数:202
POJ_2653_Pick-up sticks_判断线段相交
POJ_2653_Pick-up sticks_判断线段相交 Description Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finis ...
分类:其他好文   时间:2018-05-10 11:16:01    阅读次数:151
POJ 1065 Wooden Sticks
经典的一道题 零件分组 每个零件有两维,将零件分组,要求每组内零件严格不下降,求最小组数 将一维排序,另一维求最长上升子序列即可 下面代码写的是暴力,也能过 ...
分类:其他好文   时间:2018-05-04 14:01:26    阅读次数:152
387条   上一页 1 ... 4 5 6 7 8 ... 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!