http://acm.hdu.edu.cn/showproblem.php?pid=3277题意:有2N个孩子,其中有N个女生,N个男生,每一个女生可以找一个没有争吵过得男生组成一个家庭,并且可以和与她关系好的女生互换男生。与HDU 3081 Marriage Match II不同的是,女生交换朋友...
分类:
其他好文 时间:
2014-08-04 17:25:47
阅读次数:
219
1 概述Nios II 的boot过程要经历两个过程。FPGA器件本身的配置过程。FPGA器件在外部配置控制器或自身携带的配置控制器的控制下配置FPGA的内部逻辑。如果内部逻辑中使用了Nios II,则配置完成的FPGA中包含有Nios II软核CPU。Nios II本身的引导过程。一旦FPGA配置...
分类:
移动开发 时间:
2014-08-04 17:10:17
阅读次数:
335
题目:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function shou....
分类:
编程语言 时间:
2014-08-04 13:24:27
阅读次数:
256
问题:找出只出现一次的数,其他数出现了三次分析:将数转化为二进制的位,数出现了三次相当于其对应的二进制上每个位置出现了3次,这里有个抽象的地方就是,例如数中包含1,3两个其二进制的第一位都包含1, 怎么区分,其实并不需要区分,无论是数字3的还是数字1的二进制第一位的1都无所谓,因为我们完全可以...
分类:
其他好文 时间:
2014-08-04 10:53:27
阅读次数:
296
题目:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution ....
分类:
编程语言 时间:
2014-08-04 10:31:57
阅读次数:
239
思路:类似于上一题,但是加了一个index数组记录结果里面已经存放的元素索引,用来判断当前的元素是否和上一个相同并且上一个是否使用过。主要为了解决重复解的问题。 1 class Solution { 2 public: 3 vector >ans; 4 vector > combin...
分类:
其他好文 时间:
2014-08-03 23:01:56
阅读次数:
213
Corner cases!class Solution {public: ListNode *deleteDuplicates(ListNode *head) { if (!head) return head; if (!head->next) return hea...
分类:
其他好文 时间:
2014-08-03 07:51:34
阅读次数:
237
题目:Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to ....
分类:
编程语言 时间:
2014-08-03 05:24:06
阅读次数:
304
题目: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the foll....
分类:
编程语言 时间:
2014-08-03 05:21:18
阅读次数:
272
Problem Description
The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze was changed and the way he came in was lost.He realized that the bo...
分类:
其他好文 时间:
2014-08-02 23:31:54
阅读次数:
274