码迷,mamicode.com
首页 > 其他好文
hdu 4292 网络最大流
http://acm.hdu.edu.cn/showproblem.php?pid=4292 Problem Description   You, a part-time dining service worker in your college’s dining hall, are now confused with a new problem: serve as many pe...
分类:其他好文   时间:2015-04-06 17:23:00    阅读次数:168
[LeetCode]Plus One
简单题不解释, 维护一个进位即可public class Solution { public int[] plusOne(int[] digits) { int c = 1; for(int i = digits.length - 1; i >=0; i --){ if(c == 0)break; digits[i]...
分类:其他好文   时间:2015-04-06 17:20:23    阅读次数:155
【哈希表】Longest Consecutive Sequence
题目:leetcode Longest Consecutive Sequence   Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2]...
分类:其他好文   时间:2015-04-06 17:22:41    阅读次数:160
String to Integer (atoi)--LeetCode
这种题的考察重点并不在于问题本身,而是要注意corner case的处理,整数一般有两点,一个是正负符号问题,另一个是整数越界问题。思路比较简单,就是先去掉多余的空格字符,然后读符号(注意正负号都有可能,也有可能没有符号),接下来按顺序读数字,结束条件有三种情况:(1)异常字符出现(按照C语言的标准是把异常字符起的后面全部截去,保留前面的部分作为结果);(2)数字越界(返回最接近的整数);(3)字...
分类:其他好文   时间:2015-04-06 17:22:19    阅读次数:137
qsort函数
qsort函数:运用填写: 第一个为数组初始地址 第二个为待排序数组的个数 第三个为每个字节的大小(建议sizeof(a[0])) 第四个为函数指针(比较函数)比较函数: 一般来说比较函数的命名没有硬性的规定,但是我们一般还是用cm...
分类:其他好文   时间:2015-04-06 17:21:14    阅读次数:121
hdu 4289 利用最大流思想求图的最小割
http://acm.hdu.edu.cn/showproblem.php?pid=4289 Problem Description   You, the head of Department of Security, recently received a top-secret information that a group of terrorists is planning ...
分类:其他好文   时间:2015-04-06 17:20:57    阅读次数:233
HDU 1181 变形课 (DFS)
Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体.  Harry已经将他所会的所有咒语都列成了一个表,他想让你帮忙计算一下他是否能完成老师的作业,将一个B(...
分类:其他好文   时间:2015-04-06 17:19:58    阅读次数:127
最长上升子序列
输入数据 输入的第一行是序列的长度N (1 <= N <= 1000)。第二行给出序列中的N 个整数,这些整数的取值范围都在0 到10000。 输出要求 最长上升子序列的长度。 输入样例 7 1 7 3 5 9 4 8 输出样例 4import java.util.Scanner; public class TheMaxRiseSeries { public static vo...
分类:其他好文   时间:2015-04-06 17:20:48    阅读次数:166
cocos2d-x怎么新建项目
cocos2d-x在2.x以后的版本是使用Python命令创建的,具体步奏如下 1.下载Python,安装 2..配置Python的环境变量,系统的path变量。直接拷贝D:/ptyhon27目录粘贴就行 3.进入这个目录》E:\cocos2d-x\cocos2d-x-2.2.6\tools\project-creator (我的cocos2D-x安装在E盘) 4使用命令行执行create...
分类:其他好文   时间:2015-04-06 17:18:58    阅读次数:147
生成PowerDesigner16.5设计图大图片的方法
PowerDesigner16.5 的设计成果,一般是通过“Report->Generate Report...”导出报告。                  但是文中默认关系图片往往很小,很难辨认使用。下面介绍具体使用方法,生成任意大小的图片。         (1)使用配置报告模版(Report->Report Template...)                  (2)配...
分类:其他好文   时间:2015-04-06 17:20:22    阅读次数:314
hdu 2639 Bone Collector II
Bone Collector II Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2759    Accepted Submission(s): 1428 Problem Description The title of...
分类:其他好文   时间:2015-04-06 17:20:44    阅读次数:163
[LeetCode] Search Insert Position
Search Insert Position   Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assum...
分类:其他好文   时间:2015-04-06 17:20:12    阅读次数:134
蓝桥杯-基础练习-十六进制转八进制(被超时了!!!)
基础练习 十六进制转八进制   时间限制:1.0s   内存限制:512.0MB        问题描述   给定n个十六进制正整数,输出它们对应的八进制数。 输入格式   输入的第一行为一个正整数n (1   接下来n行,每行一个由0~9、大写字母A~F组成的字符串,表示要转换的十六进制正整数,每个十六进制数长度不超过100000。 输出格式 ...
分类:其他好文   时间:2015-04-06 17:17:40    阅读次数:217
选择问题——选出第K个最大的元素
最近在读《数据结构与算法分析(C语言描述)》,在优先队列(堆)一节中,作者总结了关于“选择问题——求第k个最大的元素”的几种思路,在此简单总结一下:第一种将这NN个数读进一个数组中,再通过某种简单的算法,比如冒泡排序、选择排序等,以递减顺序将数组进行排序,然后返回位置kk上的元素。假设使用最简单的排序算法,则运行时间为O(N2)O(N^2)第二种这是对第一种算法的简单优化。申请一个大小为kk的数组,...
分类:其他好文   时间:2015-04-06 17:16:51    阅读次数:132
求两日期之间的相隔天数(year,month,day)
主要思路理解部分看ppt #include int isRunNian(int year); int DiJiTian(int year,int month,int day); void swap(int *a,int *b); int main() { int year1,month1,day1; int year2,month2,day2; int sum=0; scanf(...
分类:其他好文   时间:2015-04-06 17:17:15    阅读次数:117
Container With Most Water--LeetCode
题目: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, ...
分类:其他好文   时间:2015-04-06 17:17:36    阅读次数:142
【LeetCode从零单排】No133. clon graph (BFS广度优先搜索)
背景(以下背景资料转载自:http://www.cnblogs.com/springfor/p/3874591.html?utm_source=tuicool)DFS(Dpeth-first Search)顾名思义,就是深度搜索,一条路走到黑,再选新的路。记得上Algorithm的时候,教授举得例子就是说,DFS很像好奇的小孩,你给这个小孩几个盒子套盒子,好奇的小孩肯定会一个盒子打开后继续再在这个...
分类:其他好文   时间:2015-04-06 17:16:36    阅读次数:191
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!