题目链接:Codeforces 468B Two Sets
题目大意:给出n个数,要求将n个数分配到两个集合中,集合0中的元素x,要求A-x也再0中,同理1集合。
解题思路:类似二分图匹配的方法。
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 1e5...
分类:
其他好文 时间:
2014-09-25 13:13:38
阅读次数:
240
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 1 /** 2 ...
分类:
其他好文 时间:
2014-09-25 13:02:08
阅读次数:
204
题目大意:
在一个1000*1000的二维平面上,每一个整点都有一个权值,权值大小是 the production in the grid points (x, y) is (x + A)(y + B) where A, B are two constant.
思路分析:
先离线处理出所有的询问,对于每一个询问都有一个极角,按照极角排序。
然后对于平面上每一个点,都依次的加入到B...
分类:
其他好文 时间:
2014-09-25 03:55:08
阅读次数:
247
Linux mint cinnamon ? ? ? how to customize theme Linux mint have two style theme- system theme and user theme? eg: system setting->themes like picture below: Void is user theme and the other is...
分类:
系统相关 时间:
2014-09-25 00:17:08
阅读次数:
425
题目链接In a rooted tree, thelowest common ancestor(or LCA for short) of two verticesuandvis defined as the lowest vertex that is ancestor of both that tw...
分类:
其他好文 时间:
2014-09-24 22:50:17
阅读次数:
296
-----QUESTION-----
Given n non-negative integers a1, a2,..., an,where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai)and (i,0). Find two lines, which together with x-axis forms ...
分类:
其他好文 时间:
2014-09-24 20:39:27
阅读次数:
218
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:
其他好文 时间:
2014-09-24 17:45:07
阅读次数:
214
第五十一题Write a C function which does the addition of two integers without using the '+' operator. You can use only the bitwise operators.(Remember the g...
分类:
其他好文 时间:
2014-09-24 00:51:55
阅读次数:
253
1.快速排序的基本思想
2.快速排序的实现
3.快速排序的改进
(1)当递归到子集元素小于一定数目(如10)时,直接进行插入排序。
(2)每次取轴点时,尽量保证其靠近median。
4.快速排序的应用
(1)找集合中的第K小数。
5.集合中有很多元素时的快速排序
当集合中有很多元素时,快速排序的...
分类:
其他好文 时间:
2014-09-24 00:19:25
阅读次数:
307