码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
POJ 1837
1 #include 2 #define MAXN 20 3 using namespace std; 4 5 int value[MAXN]; 6 int place[MAXN]; 7 int dp[MAXN][15000]; 8 9 int main()10 {11 //freo...
分类:其他好文   时间:2015-06-10 17:11:59    阅读次数:95
POJ 1844
#include #define MAXN 20using namespace std;int value[MAXN];int place[MAXN];int dp[MAXN][15000];int main(){ //freopen("acm.acm","r",stdin); int ...
分类:其他好文   时间:2015-06-10 17:04:39    阅读次数:92
Reverse Words in a String -- leetcode
Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". Update (2015-02-12): For C programmers: Try to solve it in-place in...
分类:其他好文   时间:2015-06-10 08:53:02    阅读次数:96
Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:其他好文   时间:2015-06-10 07:41:49    阅读次数:105
Java for LeetCode 213 House Robber II
Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that...
分类:编程语言   时间:2015-06-09 21:27:40    阅读次数:197
Rotate Image
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 题目解读: 将一个矩阵顺时针旋转90度。 方法一: 如下图所示,先转置,之后和变换的单位矩阵相乘...
分类:其他好文   时间:2015-06-09 17:23:38    阅读次数:129
Leetcode[27]-Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn’t matter what you leave beyond the new length.思路:遍历数组,如果...
分类:其他好文   时间:2015-06-09 11:59:43    阅读次数:115
Leetcode[26]-Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with cons...
分类:其他好文   时间:2015-06-09 11:58:43    阅读次数:86
LightOJ1010---Knights in Chessboard (规律题)
Given an m x n chessboard where you want to place chess knights. You have to find the number of maximum knights that can be placed in the chessboard such that no two knights attack each other.Those who...
分类:其他好文   时间:2015-06-08 17:32:11    阅读次数:118
hbmy周赛1--C
C - Exam Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description An exam for n students will take place in a long and narrow room, so th...
分类:其他好文   时间:2015-06-07 13:56:37    阅读次数:122
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!