- 博客(27)
- 资源 (5)
- 收藏
- 关注
原创 面试笔试算法目录
位运算寻找缺失的数字 二进制中1的个数—-位运算 检测一个数能否被3整除—-位运算 判断两个数是否符号相反—-位运算动态规划 数字转字母的编码方式的个数 —- DP 直方图最大面积 —- DP利用栈寻找下一个较大元素 — 利用栈 包含min函数的栈 —- 利用栈
2016-05-25 23:27:32 1292
原创 hdu1710 Binary Tree Traversals ----- 二叉树前序中序推后序
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1710一:原题内容Problem DescriptionA binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint bin
2016-05-28 22:31:24 1765
原创 hdu5045 Contest ---- 状态DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=5045一:原题内容Problem DescriptionIn the ACM International Collegiate Programming Contest, each team consist of three students. And the teams
2016-05-28 19:03:33 650
原创 hdu1732 Push Box ---- BFS
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1732一:原题内容Problem DescriptionPush Box is a classic puzzle game. This game play in a grid, there are five types of block in it, the player, th
2016-05-25 16:30:52 677
原创 hdu1584 蜘蛛牌 --DFS & 区间DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1584一:原题内容Problem Description蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起移动,游戏的目的是将所有的牌按同一花色
2016-05-23 18:04:26 1145
原创 福建省第七届大学生程序设计竞赛 ---- 赛后总结
虽说去年也参加过类似比赛,可是这次比赛给我的影响还是很大的,一下懂得了很多以前不知道的。这次比赛主办方是位于福州市的闽江学院(地方很大,有点迷路,)。今天星期一,也就是上周六我和带队老师还有其他参赛伙伴们从厦门出发前往闽江学院,真心远啊,累,更坑的是竟然连续下了两天雨。下面附上闽江学院的帅照,因为下雨(其实是懒),所以没有现场拍照,所以就百度到了几张:昨天上午9点整正式开始比赛
2016-05-23 09:20:58 2473
原创 LeetCode 5 : Longest Palindromic Substring ---- 最长回文
原题链接: https://leetcode.com/problems/longest-palindromic-substring/一:原题内容Given a string S, find the longest palindromic substring in S. You may assume that the maximum length ofS is 1000,
2016-05-19 18:05:22 765
原创 LeetCode 4 : Median of Two Sorted Arrays ---- 两排序数组的中位数
原题链接: https://leetcode.com/problems/median-of-two-sorted-arrays/一:原题内容There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. Th
2016-05-18 16:36:45 1187
原创 LeetCode 3 : Longest Substring Without Repeating Characters ---- 不重复的子串
原题链接: https://leetcode.com/problems/longest-substring-without-repeating-characters/一:原题内容Given a string, find the length of the longest substring without repeating characters.Examples:
2016-05-18 14:21:09 767
原创 hdu1455 Sticks ----DFS
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1455一:原题内容Problem DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. N
2016-05-17 17:25:35 901
原创 LeetCode 2 : Add Two Numbers ---- 单链表相加
原题链接: https://leetcode.com/problems/add-two-numbers/一:原题内容You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their n
2016-05-16 17:34:33 901
原创 LeetCode 1 : Two Sum ---- 哈希&数组
原题链接:https://leetcode.com/problems/two-sum/一:原题内容Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input w
2016-05-16 14:21:04 1428
原创 hdu1401 Solitaire ----双向BFS
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1401一:原题内容Problem DescriptionSolitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1
2016-05-13 19:43:21 562
原创 hdu1252 Hike on a Graph ----BFS
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1252一:原题内容Problem Description"Hike on a Graph" is a game that is played on a board on which an undirected graph is drawn. The graph is comp
2016-05-13 19:05:48 588
原创 Windows 10 + Android Studio 2.1 + HelloWorld程序
首先官网下载Android Studio最新版,地址是http://developer.android.com/sdk/index.html ,如下图:点击下载,先不要安装。打开你的任务管理器,看你的“虚拟化”是否是开启状态?如果是关闭状态,需要读者自己重启电脑进入BIOS开启。见下图:现在你可以安装了。为什么要开启虚拟化呢?因为没开虚拟化的话,inte
2016-05-12 22:01:36 1835
原创 hdu1198 Farm Irrigation ----并查集
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1198一:原题内容Problem DescriptionBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of saml
2016-05-12 13:59:03 629
原创 hdu1112 The Proper Key ----DFS+模拟
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1112一:原题内容Problem DescriptionMany people think that Tetris was invented by two Russian programmers. But that is not the whole truth. The
2016-05-12 12:26:44 1065
原创 hdu1111 Secret Code ----复数+DFS
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1111一:原题内容Problem DescriptionThe Sarcophagus itself is locked by a secret numerical code. When somebody wants to open it, he must know t
2016-05-11 15:59:45 983
原创 hdu1067 Gap----BFS+哈希
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1067一:原题内容Problem DescriptionLet's play a card game called Gap. You have 28 cards labeled with two-digit numbers. The first digit (fro
2016-05-11 15:25:12 701
原创 hdu1044 Collect More Jewels----BFS+DFS
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1044一:原题内容Problem DescriptionIt is written in the Book of The Lady: After the Creation, the cruel god Moloch rebelled against the author
2016-05-09 17:52:01 1317
原创 寻找缺失的数字
问题:给一个长度为n-1的数组,数字的范围在 1到n(无重复),其中有一个缺失的数字,找出该数字。要求时间复杂度为O(n),空间复杂度为O(1).方法1 使用公式1 + 2 + … + n 的公式为 n*(n+1)/2,知道了总和,再前去数组的总和,即为缺失的数字。int getMissingNo (int a[], int n){ int i, total;
2016-05-07 13:02:28 1938
原创 二进制中1的个数----位运算
题目描述:输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。样例输入:45-1样例输出:1232#include#includeusing namespace std;int main(){ unsigned int x; while (1) { cin >> x; int num = 0; while (x)
2016-05-05 20:38:25 596
原创 检测一个数能否被3整除----位运算
第一个解决方案就是小学就学过的,如果一个数的每个位相加之和能被3整除,则这个数就可以被3整除。例如612各位之和为9,则可以被3整除。但是这个解决方法并不高效,我们需要取得每一位,然后再一个个相加。观察二进制,我们可以找到一个模式来判断一个数能否被3整除。如果所有的偶数位出现1的次数为 even_count, 奇数位出现1的次数为 odd_count,两者只差如果是3的倍数,那么这个数就是3倍
2016-05-05 18:56:53 4610
原创 判断两个数是否符号相反----位运算
问题:写一个函数,判断给定的两个数字是否是符号相反的,不可以使用比较运算符。例如 fun(-1, 100) == true; fun(5,6)=false; fun(-1,-2)=false; 同时,规定0属于正数。在二进制表示中,最高位是1的话,就是负数。最高位为0则为正数。因此我可以想办法通过位运算来判断。1 ^0 = 1。所以 负数^正数=负数。其实就是类似于乘法了。#i
2016-05-05 18:06:53 9442 2
原创 OpenCV3.0 Beta + Windows10 + Visual Studio 2015 配置
opencv3.0下载地址:http://jaist.dl.sourceforge.net/project/opencvlibrary/opencv-win/3.0.0/opencv-3.0.0.exe下载好后解压(双击就会出现解压界面),我是解压在D盘根目录。找到系统变量path路径加入下面两个路径:两个路径建议都加进去。重启电脑!!!打开vs新建一个C++w
2016-05-04 16:16:27 1416
Unity圣典.chm
2015-12-05
Unity3D中的线性插值Lerp()函数解析
2015-12-03
Sublime Text2汉化包
2015-11-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人