Colored Sticks Time Limit: 5000MS Memory Limit: 128000K Total Submissions: 38355 Accepted: 10044 Description You are given a bunch of wooden sticks. E ...
分类:
其他好文 时间:
2018-02-13 12:32:20
阅读次数:
187
Sticks Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 150282 Accepted: 35746 Description George took sticks of the same length and cut the ...
分类:
其他好文 时间:
2018-02-04 21:11:36
阅读次数:
200
难度:β- 建议用时:30 min 实际用时:40 min 题目:🔗 代码:🔗 这题是我目前做的最快的一题。 因为我看了别人的题解。 代码照着别人抄的,当然做的快。 我现在有些不好意思了。 现在只是在别人的基础上说些我的理解。 这题用 DFS 很好说。然而剪枝我开始没想到。事后想一想也有道理。 ...
分类:
其他好文 时间:
2018-01-30 12:42:15
阅读次数:
163
【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 用cnt[i]记录数字i出现的次数就好。 然后i从1e6逆序到1 如果cnt[i+1]和cnt[i] 0同时成立的话。 那么得到一条边。加入到vector中。 然后 如果cnt[i] 1 则cnt[i] =2 加入i到vecto ...
分类:
其他好文 时间:
2018-01-29 15:41:36
阅读次数:
137
Sticks Problem 题目大意:给你一串n个数的数列a,上面的数为a1到an。我们求最大的y-x,其中,y和x满足1.x<y 2.任意的x<i<y,都有ai>ax&&ai<ay。 注释:n<=50000,ai<=100000 想法:我们很容易就想到,松弛x。那么,对于任意的x,y都必须满足这 ...
分类:
其他好文 时间:
2018-01-15 20:36:51
阅读次数:
137
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 sticks to ...
分类:
其他好文 时间:
2017-12-07 23:56:06
阅读次数:
248
Given a set of sticks of various lengths, is it possible to join them end to end to form a square? Input The first line of input contains N, the numbe ...
分类:
其他好文 时间:
2017-12-07 18:53:47
阅读次数:
141
题意 : 有n根木棍(n<=64),它们由一些相同长度的木棍切割而来,给定这n根木棍的长度,求使得原来长度可能的最小值。 分析 : 很经典的深搜题目,我们发现答案只可能是所有木棍长度总和的因数,那么我们只要去枚举因数然后搜索是否可行即可!具体实现看代码可能更容易看懂,这里不赘述。重要的是体会此类深搜 ...
分类:
其他好文 时间:
2017-12-02 20:20:15
阅读次数:
198
题目链接:http://poj.org/problem?id=2513 题目大意:你有好多根棍子,这些棍子的两端分都别涂了一种颜色。请问你手中的这些棍子能否互相拼接,从而形成一条直线呢? 两根棍子只有在颜色相同的时候才能拼接。比如有两根棍子,第一根棍子的两端的颜色分别为blue green,第二根两 ...
分类:
其他好文 时间:
2017-11-30 21:42:38
阅读次数:
193
一.题目类型: 1.普通并查集: poj2513 Colored Sticks hdu1198 Farm Irrigation SCAU 1138 代码等式 Gym - 100676F Palindrome Codeforces Round #363 (Div. 2) D. Fix a Tree C ...
分类:
其他好文 时间:
2017-11-04 16:28:20
阅读次数:
138