码迷,mamicode.com
首页 >  
搜索关键字:each    ( 14050个结果
【LeetCode】Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:其他好文   时间:2014-05-26 18:46:20    阅读次数:251
ProjectEuler 005题
题目:2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that...
分类:其他好文   时间:2014-05-26 02:12:53    阅读次数:167
LeetCode:Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are   stored in  reverse order and each of their nodes contain a single digit. Add the two numbers   and return i...
分类:其他好文   时间:2014-05-25 21:36:52    阅读次数:268
一个让人崩溃的编码错误
最近写了一个接受socket数据包,然后再重组上层协议包的东西。每次read到数据就将数据添加到一个链表的尾部,然后检查是否收到了一个完整的包。为了减少内存碎片,把用过的链表节点添加到另外一个链表中,这样下次可以从这个cache链表中重用节点。        在debug的时候我把cache list中的数据打印出来,代码如下: struct seg_node {     void* bu...
分类:其他好文   时间:2014-05-25 21:31:09    阅读次数:326
【LeetCode】Remove Duplicates from Sorted Array
Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new len...
分类:其他好文   时间:2014-05-25 19:08:31    阅读次数:203
Java 并发专题 : CyclicBarrier 打造一个安全的门禁系统
继续并发专题~ 这次介绍CyclicBarrier:看一眼API的注释: /** * A synchronization aid that allows a set of threads to all wait for * each other to reach a common barrier point. CyclicBarriers are * useful in program...
分类:编程语言   时间:2014-05-25 18:15:06    阅读次数:316
转化一下就是01背包 CodeForces 433A - Kitahara Haruki's Gift
Kitahara Haruki has bought n apples for Touma Kazusa and Ogiso Setsuna. Now he wants to divide all the apples between the friends. Each apple weights 100 grams or 200 grams. Of course Kitahara Haru...
分类:其他好文   时间:2014-05-25 09:01:36    阅读次数:174
POJ1753——Flip Game
Flip GameDescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is w...
分类:其他好文   时间:2014-05-25 03:21:52    阅读次数:255
【LeetCode】Climbing Stairs
题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? 解答...
分类:其他好文   时间:2014-05-25 00:37:34    阅读次数:284
LeetCode: N-Queens [050]
【题目】 The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. Each solution contains a distinct board configuratio...
分类:其他好文   时间:2014-05-24 17:12:32    阅读次数:237
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!