码迷,mamicode.com
首页 >  
搜索关键字:each    ( 14050个结果
POJ2442——Squence(二叉堆+动态规划 | 滚动数组)
本文出自:http://blog.csdn.net/svitter 题意分析: Given m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It's clear ...
分类:其他好文   时间:2014-08-03 12:54:15    阅读次数:912
POJ - 3468 A Simple Problem with Integers (区间求和)
Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other ...
分类:其他好文   时间:2014-08-03 12:53:25    阅读次数:311
Populating Next Right Pointers in Each Node
问题:将二叉树的所有结点指向他的右边的一个结点分析:对于每一个结点来说,其操作都是一样的,除了他的左儿子指向右儿子外,其左儿子的全部右后辈均指向其右儿子的全部左后辈/** * Definition for binary tree with next pointer. * struct TreeLin...
分类:其他好文   时间:2014-08-03 10:12:05    阅读次数:178
Triangle leetcode java
题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the....
分类:编程语言   时间:2014-08-03 04:40:04    阅读次数:351
POJ 3895 Cycles of Lanes
Description Each of the M lanes of the Park of Polytechnic University of Bucharest connects two of the N crossroads of the park (labeled from 1 to N). There is no pair of crossroads connected by mo...
分类:其他好文   时间:2014-08-02 23:27:14    阅读次数:327
【代码优化】for-each代替普通的for循环或者while循环
对于集合的遍历首选方法是for-each for(Element e :c){ doSomething(e); } 这是1.5版本之后的做法;java1.5之前使用的是Iterator迭代器。 为了弄清楚为啥比普通的for循环或者whlie循环好,请看一下代码 Iterator i=c.iterator(); while(i.hasNext()){...
分类:其他好文   时间:2014-08-02 23:26:54    阅读次数:356
POJ 3435 Sudoku Checker
Description The puzzle game of Sudoku is played on a board of N2 × N2 cells. The cells are grouped in N × N squares of N × N cells each. Each cell is either empty or contains a number between 1 a...
分类:其他好文   时间:2014-08-02 23:26:34    阅读次数:344
POJ 3268 Silver Cow Party
?? Silver Cow Party Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 12633   Accepted: 5631 Description One cow from each of N farms (1 ≤ N ≤ 1000) convenien...
分类:其他好文   时间:2014-08-02 18:29:13    阅读次数:289
ZOJ 1642 Match for Bonus(dp)
Match for Bonus Time Limit: 2 Seconds      Memory Limit: 65536 KB Roy played a game with his roommates the other day.  His roommates wrote 2 strings of characters, and gave each character a b...
分类:其他好文   时间:2014-08-02 18:20:33    阅读次数:256
POJ - 2886 Who Gets the Most Candies? (反素数+线段树)
Description N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. Th...
分类:其他好文   时间:2014-08-02 15:37:33    阅读次数:259
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!