码迷,mamicode.com
首页 >  
搜索关键字:HERE    ( 6715个结果
[LeetCode]Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integer...
分类:其他好文   时间:2015-04-06 11:29:06    阅读次数:121
【贪心专题】POJ 2456 Aggressive cows && NYOJ 586 疯牛(最大化最小值 贪心+二分搜索)
链接: click here~~ 题意:农夫 John 建造了一座很长的畜栏,它包括N (2 但是,John的C (2 【解题思路】其实就是给你n个坐标,让你选m个(m 类似的最大化最小值或者最小化最大值的问题,通常用二分搜索法可以很好解决,我们定义:C(d)=可以安排的牛的位置使得最近的两头牛的距离不小于d,那么问题就变成了求满足C(d)的最大的d,其实也就是说,C(d)=可...
分类:其他好文   时间:2015-04-05 23:39:53    阅读次数:383
【贪心专题】POJ 1323 && HDU 1338 Game Prediction (贪心)
链接:click here~~ 题意: 有m个人,每个人有n张牌,牌点为在1~n*m中的不同的数。每回合每个人出一张牌,点数最大的那个人赢,给出A人初始时的n张牌的牌点,问A至少赢的次数。 【解题思路】 看做两个人互相出牌,注意出牌的顺序,你有m张牌,我有m*(n-1)张牌,每次我都出比你大一点的牌,如果没有,出最小的m张牌(可以忽略), 每次出最大的。如果别人手中最大的小于你的...
分类:其他好文   时间:2015-04-05 23:36:36    阅读次数:160
【贪心专题】POJ 3258 River Hopscotch (最大化最小值 贪心+二分搜索)
链接:click here~~ 【题意】 一条河长度为 L,河的起点(Start)和终点(End)分别有2块石头,S到E的距离就是L,河中有n块石头,每块石头到S都有唯一的距离,,现在要你移除其中的m块,使得具有最小间距的相邻两块石头之间的距离最大。 【解题思路】 又是一道经典的二分搜索,跟前一道一样的思路,不过要注意的是:此题是移除其中的元素,从而达到最大化的最小值。 ...
分类:其他好文   时间:2015-04-05 23:36:27    阅读次数:284
Leetcode: Reverse Integer 正确的思路下-要考虑代码简化
题目:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ...
分类:其他好文   时间:2015-04-05 21:47:56    阅读次数:145
zoom to raster resolution
don't execute the ESRI's command, just find out and write codes to zoom to the raster resolution. Here they are, I hope they will help.Unfortunately (...
分类:其他好文   时间:2015-04-05 13:22:22    阅读次数:325
分布式排序
周六早晨, 从Leetcode的问题开始, 读代码感觉可读性太差; 知道了算法, 却抽象思维跟不上代码.Here is the leetcode link I am reading in the morning:http://yucoding.blogspot.ca/2014/12/leetcode...
分类:编程语言   时间:2015-04-05 06:18:56    阅读次数:188
The Django Book学习笔记 06 admin
自定义字段标签自定义一个标签, 你只需在模块中指定verbose_name=' 'from django.db import models# Create your models here.from django.db import modelsclass Publisher(models.Mode...
分类:其他好文   时间:2015-04-04 19:46:15    阅读次数:123
sql分页存储过程配合jquery 分页控件
ALTER PROCEDURE [dbo].[getData] -- Add the parameters for the stored procedure here@tb varchar(150),@status nchar(2),@indexpage int,@endpage intASdecl...
分类:数据库   时间:2015-04-04 12:02:41    阅读次数:142
sublime 设置
// While you can edit this file, it's best to put your changes in// "User/Preferences.sublime-settings", which overrides the settings in here.//// Set...
分类:其他好文   时间:2015-04-03 23:50:37    阅读次数:200
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!