自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(125)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 Unity3d的Mono编辑不了的问题

在Unity3d中添加了C#脚本,却发现新增加的脚本怎么打字都不显示,而老的脚本却可以,新的脚本可以删除却不能输入。重启了之后还是不行,很郁闷,不知道为什么。后来突然想到之前不小心手贱点了全部项目的SVN,设置了目录,虽然后来在VisualSVN中取消了整个项目的repository,但是因为文件夹下有.svn目录,所以可能还是会有效果(我的电脑VisualSVN和TortoiseSVN都

2016-04-16 18:54:12 2029

原创 Unity3d中添加json的system.web.script.serialization

在Unity3d中,客户端有需要解析服务器传过来的json数据,可是处理json的System.Web.Script.Serialization。如图:在MonoDevelop中,点击右侧的References->Edit References在出来的页面中搜索System.Web.Extensions,选中,然后OK就会看到左侧已经添加好了,右侧代码也不会

2016-03-11 13:08:41 1494

原创 找出1到n中重复的数字

背景:很早以前在CSDN中MoreWindows的白话算法中看到,以为那个就是最佳的方法,后来在LeetCode中做到,再后来在和同学讨论中又深化了一下。一道很经典的题目,算法无止境。题目:在数组nums[n + 1]中,数字都是1到n范围内的,那么至少有一个重复数字,找到它。分析:这其实是一道比较简单的算法题,但是,如果是面试题,面试官除了用时间复杂度和空间复杂度来约束你

2015-10-20 21:14:10 5069 1

原创 strcat

背景:有了String类之后,重载了operator +操作符,字符串的相加已经变得异常容易了。但是,strcat还是会时常出现在我们的眼前。看了一些资料,总结了一下。C的strcat:C的strcat是最初的strcat,也是不安全的strcat。(当然,不安全的不止是strcat,和char*相关的很多比如strcpy等也都是不安全的)它的源代码如下:char * __

2015-10-19 13:29:15 1165

原创 从1到15有几种方法

一道笔试题:题目:从一个数字只能加1或乘以2,问f(15)等于多少?(相当于说从1到15有几种方法)分析:初一看,这个问题应该是个子问题,f(n)和f(m)应该有点关系。但是又不好说是什么关系。我们先来看一下一个经典问题:走台阶问题,每次走台阶,你只能一次走一格,或者一次性走两个,问你走10格有几种方法。那么我们可以看到,f(n)它可以由f(n-1)走一格上来,也可以由

2015-10-18 23:43:40 1459

原创 有多少种走法

一道笔试题:题目:如下图:在10*10的方格中,要从start(0,0)起点走到end(10,10)终点,其中每一步只能是向上走一步或者是向右走一步。并且在(5,5)的位置有一个坑,是不能走的。问从start到end一共有多少种走法?分析:其实,这是一道比较简单的排列组合问题,只要你把它抽象出来。可以看到,从(0,0)到(10,10)的路径上,我们总

2015-10-18 22:47:55 1750

原创 开心果

面试纠结,来一发开心果。面试官:同学你好,先写一下kmp算法。我在纸上写上:“kmp算法”。面试官:接着说一下C++的traits特征提取吧。我:“C++的traits特征提取吧”。面试官:非常好,你完全符合我们的要求,给你offer。在纸上写上了:offer,然后递给我。哇哈哈~~~

2015-10-18 22:23:28 707

原创 总的路径长度(微软笔试题)

题目链接:http://hihocoder.com/contest/mstest2015sept2/problem/2题目:题目2 : Total Highway Distance时间限制:10000ms单点时限:1000ms内存限制:256MB描述Little Hi and Little Ho are playing

2015-10-07 17:30:37 940

原创 有多少个斐波那契子数列(微软笔试题)

题目链接:http://hihocoder.com/contest/mstest2015sept2/problem/3题目:题目3 : Fibonacci时间限制:10000ms单点时限:1000ms内存限制:256MB描述Given a sequence {an}, how many non-empty sub-se

2015-10-06 16:06:28 1190

原创 离圆心最远的整数点(微软笔试题)

题目链接:http://hihocoder.com/contest/mstest2015sept2/problem/1题目:题目1 : Farthest Point时间限制:5000ms单点时限:1000ms内存限制:256MB描述Given a circle on a two-dimentional plane.

2015-10-06 15:28:40 1565

原创 线段树解析

概念:线段树是一种特殊的结构,它每个节点记录着一个区间和这个区间的一个计数,表示此区间出现的次数。线段树分为构造build部分,插入insert部分,以及查询query部分。其主要的思想就是用空间换时间,来使一些特殊的问题的时间复杂度减少。比如对于一段空间或者一个数字的出现次数,以线段树来查询可以使时间复杂度从乘法减少到log,具体的复杂度分析可以看参考资料1:http://blog.cs

2015-09-27 23:01:39 3999 3

原创 数组指针解析

题目:最近看到一道模拟题,题目如下:#include#include#include#include#includeusing namespace std;int main(){ int n[][3] = { 10, 20, 30, 40, 50, 60 }; int(*p)[3]; p = n; cout << p[0][0] << "," << *(p[0] + 1

2015-09-27 21:45:50 3441 2

原创 找出最长的胖子

题目:有一个Boolean组成的矩阵,大小是N*M,代表路面,能不能在上面行走,假设胖子的形状都是正方形,也就是s*s的矩阵,其中s代表胖子的边长,现在想寻找从矩阵最左上角能走到矩阵最右下角的最大腰围的胖子。而胖子只能往右边和往下面两个方向移动,且每次只能移动一步。要求每次胖子所占用的地面都是可以在上面行走的,也就是都是值为true的元素。分析:举个栗子,有以下的矩阵,(其中绿色代表的

2015-09-27 21:13:43 3336 1

原创 1103. Integer Factorization (30)

题目链接:http://www.patest.cn/contests/pat-a-practise/1103题目:The K-P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to wr

2015-09-13 13:54:34 2666 1

原创 1102. Invert a Binary Tree (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1102题目:The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert

2015-09-13 13:48:14 2140

原创 1101. Quick Sort (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1101题目:There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the

2015-09-13 13:44:32 1976

原创 1100. Mars Numbers (20)

题目链接:http://www.patest.cn/contests/pat-a-practise/1100题目:People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars.The numbers 1 to 12 on Earch is called "

2015-09-13 13:37:45 2427

原创 用栗子打倒C++多态

写在前面:题目不是标题党哈,因为我比较喜欢把我自己理解的东西,然后写出例子,并且画出图(我的画图水平还是可以的啦)来深入浅出得让别人理解。C++的多态啊,虚函数,继承,虚表等等东西大家学过C++的都知道,但是如果要说出其中的所以然来,还真不一定说得明白和准确。我自己也是看了很多博客,以及不少书籍,所以想总结一下,作为知识的梳理,也希望给疑惑的人给予解惑。参考资料:http://

2015-09-11 14:41:46 5839

原创 微软hiho上的笔试题:Tower Defense Game

题目链接:http://hihocoder.com/contest/mstest2015sept1/problem/3题目:题目3 : Tower Defense Game时间限制:10000ms单点时限:1000ms内存限制:256MB描述There is a tower defense game with n le

2015-09-10 01:39:49 4582 1

原创 1099. Build A Binary Search Tree (30)

题目链接:http://www.patest.cn/contests/pat-a-practise/1099题目:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node co

2015-09-09 15:42:05 1932

原创 1098. Insertion or Heap Sort (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1098题目:According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each

2015-09-09 15:39:30 2246

原创 1097. Deduplication on a Linked List (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1097题目:Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That

2015-09-09 12:39:53 2027

原创 1096. Consecutive Factors (20)

题目链接:http://www.patest.cn/contests/pat-a-practise/1096题目:Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7

2015-09-09 12:38:05 2163

原创 1095. Cars on Campus (30)

题目链接:http://www.patest.cn/contests/pat-a-practise/1095题目:Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars

2015-09-09 12:34:04 1928

原创 1094. The Largest Generation (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1094题目:A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your ta

2015-09-09 12:32:30 1978

原创 1093. Count PAT's (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1093题目:The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second

2015-09-08 22:42:38 1857

原创 1092. To Buy or Not to Buy (20)

题目链接:http://www.patest.cn/contests/pat-a-practise/1092题目:Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorf

2015-09-08 22:40:35 1808

原创 1091. Acute Stroke (30)

题目链接:http://www.patest.cn/contests/pat-a-practise/1091题目:One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which th

2015-09-08 22:37:53 1797

原创 1090. Highest Price in Supply Chain (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1090题目:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from suppl

2015-09-08 22:34:28 1790

原创 1089. Insert or Merge (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1089题目:According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each

2015-09-08 22:31:18 8022

原创 1088. Rational Arithmetic (20)

题目链接:http://www.patest.cn/contests/pat-a-practise/1088题目:For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quo

2015-09-08 22:25:23 8172

原创 1087. All Roads Lead to Rome (30)

题目链接:http://www.patest.cn/contests/pat-a-practise/1087题目:Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least co

2015-09-08 22:22:41 8647

原创 1086. Tree Traversals Again (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1086题目:An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary

2015-09-08 22:18:55 5933

原创 1085. Perfect Sequence (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1085题目:Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M Now give

2015-09-08 22:17:24 8427

原创 1084. Broken Keyboard (20)

题目链接:http://www.patest.cn/contests/pat-a-practise/1084题目:On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will n

2015-09-08 22:15:08 4684 1

原创 1083. List Grades (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1083题目:Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increa

2015-09-08 22:13:25 8229

原创 1082. Read Number in Chinese (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1082题目:Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output "Fu" first if it is neg

2015-09-07 19:06:32 9358 3

原创 1081. Rational Sum (20)

题目链接:http://www.patest.cn/contests/pat-a-practise/1081题目:Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum.Input Specification:Each

2015-09-07 19:04:55 4870

原创 1080. Graduate Admission (30)

题目链接:http://www.patest.cn/contests/pat-a-practise/1080题目:It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would

2015-09-07 19:02:35 8409

原创 1079. Total Sales of Supply Chain (25)

题目链接:http://www.patest.cn/contests/pat-a-practise/1079题目:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from suppl

2015-09-07 18:56:16 8120

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除