题目的大致意思是: 如今有n根木棍,然后须要把它们拼成相同长度的木棍,问满足这个条件的最短的长度是多少? 想法嘛:那肯定是dfs把长度搜一遍就好,但问题的关键是这里会超时。那么就要用到剪枝的原理了。 下面部分是来自于pku的gw老师说哒 1)不要在同一个位置多次尝试同样长度的木棒(在某一次拼接时选择 ...
分类:
其他好文 时间:
2017-05-05 10:45:38
阅读次数:
161
比较考察技术含量的一道题。 参考链接:http://blog.csdn.net/lyy289065406/article/details/6647445 题目链接:http://poj.org/problem?id=2513 首先差不多能想到这事欧拉路,然后发现没法构图。没有尝试使用map,刚好最近 ...
分类:
其他好文 时间:
2017-05-02 17:22:35
阅读次数:
264
spark笔记big dataspark 比较Hadoop生态圈:MapReduce Hive Storm Yarn Sqoop Flume HDFSSpark它会代替Hadoop:不能,可能会替代MR炒作 社区比较完善hadoop3.0作者:Doug cutting(hadoop以后也要走内存)S... ...
分类:
其他好文 时间:
2017-04-27 17:48:36
阅读次数:
242
- Colored Sticks POJ - 2513 - Colored Sticks You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it pos ...
分类:
其他好文 时间:
2017-04-24 23:22:18
阅读次数:
291
简单贪心。 将所给数据从小到大进行排序,将所给零件的两数据均小于还有一个零件的两数据,看做一个集合。 最后输出集合个数。#include<iostream> #include<stdlib.h> #include<stdio.h> #include<string.h> #include<algori ...
分类:
其他好文 时间:
2017-04-23 18:07:16
阅读次数:
111
Geniric helps to reuse the methods which avoid overloading methods that will become hard to maintain If we have a need to add a cross cutting aspect t ...
分类:
其他好文 时间:
2017-04-21 16:45:21
阅读次数:
207
传送门 Description Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w ...
分类:
其他好文 时间:
2017-04-21 00:12:53
阅读次数:
286
题意: 给你两串小写字符串a和b,问能否将a拆成三段重新组成b 做法: 枚举拆分位置,也就是C(2,4999)。然后judge时用滚动哈希判断字符串是否匹配。 PS: WA了好多发,因为爆int(忘记1LL,取模没取好...)。滚动哈希不一定能A,但基本都能A。 1 2 3 4 5 6 7 8 9 ...
分类:
其他好文 时间:
2017-04-18 21:52:26
阅读次数:
194
1 //Sticks1011 By XieJiang 20170417 2 /** 3 *0.最小木棍的长度一定小于等于所有木棍长度之和,大于等于输入的最长的木棍 4 *1.当Sticks[i]可用时,而Sticks[i-1]不可用且Sticks[i-1]=Sticks[i],Sticks[i]不可... ...
分类:
其他好文 时间:
2017-04-18 00:42:19
阅读次数:
235
Description You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a st ...
分类:
其他好文 时间:
2017-04-07 23:31:38
阅读次数:
209