首页 > 其他
HDU 1495 非常可乐(BFS 倒水问题)
题意  将体积为s的可乐  利用容积分别为n和m的两个杯子平均分为两份  至少需要倒多少次可乐 可以把容器s,n,m中装的可乐量看成一种状态  容器都是没有刻度的  所以每次倒可乐要么把自己倒完 要么把对方倒满  每种状态可以通过一次倒水到达哪些状态  于是可以通过bfs判断到达每种状态需要倒多少次   3个容器中有一个装的可乐为s/2的状态就是答案了  s是奇数时明显不可能平分的  可以...
分类:其他   时间:2015-04-01 11:29:14    收藏:0  评论:0  赞:0  阅读:217
ListView 自定义BaseAdapter实现单选打勾(无漏洞)
最近因为一个项目的原因需要自定义一个BaseAdapter实现ListVIew单选打勾的功能,虽然听起来很简单,我在网上也 看过一些例子,似乎是实现了,但往往存在一些漏洞。往往漏洞如下 1、网上例子item较少,item增多时漏洞出现,忽略了BaseAdapter中getView()方法中convertView重用的问题 2、忽略了BaseAdapter中getView()方法并不是一下子加载完所有item,上下拖动listview时item会重新加载,getview会重新被调用,所以上下拖动的时候漏洞出 ...
分类:其他   时间:2015-04-01 11:28:54    收藏:0  评论:0  赞:0  阅读:245
LeetCode-Substring with Concatenation of All Words
题目链接: https://leetcode.com/problems/substring-with-concatenation-of-all-words/ 参考链接: http://www.w2bc.com/Article/14500 思路: 题目大意为,给定一个字符串S和一个字符串数组L,L中的各字符串长度均相等。找出S中所有的子串,这些子串恰好包含L中所有字符各一次,返...
分类:其他   时间:2015-04-01 11:28:34    收藏:0  评论:0  赞:0  阅读:224
SWT 托盘
package com.yc.ui; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import org.eclipse.jface.dialogs.MessageDialog; import...
分类:其他   时间:2015-04-01 11:28:14    收藏:0  评论:0  赞:0  阅读:375
【SICP练习】152 练习4.8
练习4-8原文Exercise 4.8. “Named let” is a variant of let that has the form (let )The and are just as in ordinary let, except that is bound within to a procedure whose body is a...
分类:其他   时间:2015-04-01 11:28:04    收藏:0  评论:0  赞:0  阅读:284
uva 590 Always on the run(dp)
uva 590 Always on the runScreeching tires. Searching lights. Wailing sirens. Police cars everywhere. Trisha Quickfinger did it again! Stealing the `Mona Lisa’ had been more difficult than planned, but...
分类:其他   时间:2015-04-01 11:27:54    收藏:0  评论:0  赞:0  阅读:233
Sublime Text3 中文输入(不需要安装gtk及其他库)
最近在用sublime text3 ,感觉这个编辑软件非常好用,唯一美中不足的是它,他,她不支持中文输入。很让人头疼,还要在别的编辑器上面拷贝,所以上网搜了好多资料,发现都是说建立编译环境,要安装gtk,libgtk,还有一些其他的库。搞得系统很乱很乱,到最后也没有编译通过,太麻烦了。 这其实只需要下载一个插件,就一切ok了。 下载InputHelper.tar.gz这个插件,大家可以在网上下...
分类:其他   时间:2015-04-01 11:27:14    收藏:0  评论:0  赞:0  阅读:181
Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 operations permitted on a word:...
分类:其他   时间:2015-04-01 11:26:54    收藏:0  评论:0  赞:0  阅读:230
cc、gcc、g++、CC的区别概括 /bin/bash cc 命令找不到
gcc是C编译器;g++是C++编译器;linux下cc一般是一个符号连接,指向gcc;gcc和g++都是GUN(组织)的编译器。而CC则一般是makefile里面的一个名字,即宏定义,嘿,因为Linux/Unix都是大小写敏感的系统,这点一定要注意。 cc是Unix系统的C Compiler,而gcc则是GNU Compiler Collection,GNU编译器套装。gcc原名为Gun ...
分类:其他   时间:2015-04-01 11:26:04    收藏:0  评论:0  赞:0  阅读:301
Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()...
分类:其他   时间:2015-04-01 11:24:54    收藏:0  评论:0  赞:0  阅读:272
leetcode || Spiral Matrix
problem: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix: [ [ 1, 2, 3 ], [ 4, 5, 6 ],...
分类:其他   时间:2015-04-01 11:24:14    收藏:0  评论:0  赞:0  阅读:238
HBase1.0.0源码分析之Client启动连接流程
我们知道在使用HBase的过程中首要的是和服务器端取得链接,那么客户端是如何去链接的,它是怎么找到master和regionserver的? 参与该过程中的主要组件又有哪些?这些组件之间是如何协同工作的呢? 今天就让我们来一起解析....
分类:其他   时间:2015-04-01 11:24:04    收藏:0  评论:0  赞:0  阅读:261
BZOJ 1142 POI2009 Tab Hash
题目大意:给定两个矩阵,保证矩阵内所有元素都不相同,求第一个矩阵通过交换行和列是否可以得到第二个矩阵 令每一行的哈希值为这一行的元素排序后的RK哈希值,将行按照哈希值排序 然后把每一列按顺序哈希一下,排个序取RK哈希作为整个矩阵的哈希值 判断两个矩阵的哈希值是否相等即可 由于矩阵中元素不重复所以可以保证第一步的哈希值不会出现重复 然后。。。我都写完了它告诉我是2B题???? 算了反正P...
分类:其他   时间:2015-04-01 11:23:54    收藏:0  评论:0  赞:0  阅读:197
leetcode || 55、Jump Game
problem: 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 maximum jump length at that...
分类:其他   时间:2015-04-01 11:22:44    收藏:0  评论:0  赞:0  阅读:160
leetcode_num75_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 integers ...
分类:其他   时间:2015-04-01 11:22:04    收藏:0  评论:0  赞:0  阅读:192
Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is def...
分类:其他   时间:2015-04-01 11:21:24    收藏:0  评论:0  赞:0  阅读:223
1.3 起步 - Git 基础
Git 基础 那么,简单地说,Git 究竟是怎样的一个系统呢?请注意,接下来的内容非常重要,若是理解了 Git 的思想和基本工作原理,用起来就会知其所以然,游刃有余。在开始学习 Git 的时候,请不要尝试把各种概念和其他版本控制系统(诸如 Subversion 和 Perforce 等)相比拟,否则容易混淆每个操作的实际意义。Git 在保存和处理各种信息的时候,虽然操作起来的命令形式非常相近...
分类:其他   时间:2015-04-01 11:20:55    收藏:0  评论:0  赞:0  阅读:211
《梦断代码》读后Ⅲ
第8章白板上的即时贴自己编写的程序与软件要自己使用,可以更加便利的推广自己的产品做东西的时候,有目标有计划,而且还要比原计划快点,这样能比预先的效果做的更好,就算出了问题,也有时间解决要结成小组,要每天讨论进度和计划,晚上说说遇到的困难怎么解决,共同进退增加对软件编写的人数,不一定就能成比例缩减交程...
分类:其他   时间:2015-04-01 11:17:43    收藏:0  评论:0  赞:0  阅读:112
一种不用参数交换两变量值的方法
#include int main(){ int a,b; scanf("%d%d",&a,&b); a=a+b; b=a-b; a=a-b; printf("%d %d\n",a,b); return 0;}
分类:其他   时间:2015-04-01 11:17:34    收藏:0  评论:0  赞:0  阅读:90
梦断代码读后感(一)
好程序员懂得些什么,而卓越的程序员知道该写(并复用)什么。 当我读这本书之前,我以为书本内容都是和代码有关的枯燥的内容而已,但是,从翻开第一页开始,我就觉得作者讲述的这些经历今后将成为我以后工作的经验学习。 本书的内容大都是故事类型的结合工作经验,总结出的实践之道。从上软件工程课程起,那些以...
分类:其他   时间:2015-04-01 11:17:23    收藏:0  评论:0  赞:0  阅读:115
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!