自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

转载 C++ CONST (1)

const用于修饰函数时,一般是const修饰类的成员函数(函数定义体),表示在函数体中成员变量不能改变; 其函数形式为:int ff(void)const; const修饰函数的返回值,用于返回常量; 如const int ff(); //返回的是常量,所以必须这么调用 const int a=ff(); 又如给”指针传递”的函数返回值加const,则返回值不能被直接修改,且该返回值只能...

2018-07-30 13:37:36 159

转载 Python中的copy和deepcopy

https://blog.csdn.net/qq_32907349/article/details/52190796 copy:简单对象的复制,复杂对象并未独立出来 deepcopy:完全复制一个独立个体 ‘=’等号:相当于为实体贴标签

2018-04-23 18:53:42 426

原创 C++

1 全局变量和局部变量名字相同时,用i初始化i有问题,因为int i声明后,i就是局部变量,而非全局变量,因此int i = i中的后面哪个i是未定义的变量i。 #include <iostream> using namespace std; int i = 1; int main() { int i = i; return 0; } 2. int&...

2018-02-07 21:48:28 189

原创 Blender脚本编程

渲染的主体是IsoSurface,对这个材质的设置手动一次性完成就行,不用每次导入obj都重复做一遍,所以不需要在脚本里设置。需要注意的是,以下脚本是在我手动渲染了第一张图片后再运行的,对应的旋转、变换大小、位移都是参照第一次渲染所选择的参数,所以我建议最好先手动渲染一次,选择好恰当的参数以及摄像机位置和光照后再进行脚本化渲染。另外,以下步骤其实和我的另外一篇博客的步骤是类似的,只是在这里把人工操作

2017-08-22 00:30:19 2712 1

原创 如何使用Blender将点模型的obj文件渲染成网格模型

资源文件:obj文件,记录着模型中每个粒子的坐标 工具:Blender,CubeSurfer插件(download:http://pyroevil.com/cubesurfer-addon-download/) 目的:将obj中的粒子模型渲染成网格面模型的效果具体步骤:1:导入obj文件 Blender有导入obj的功能,但是需要在文件->用户设置->插件这里把导入obj打上勾才能导入obj,

2017-06-05 21:20:20 10630 2

原创 Decode String

Problem :Given an encoded string, return it’s decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k

2017-01-07 16:35:12 314

原创 Different Ways to Add Parentheses——Difficulty:Medium

Problem :Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.Example:E

2017-01-07 15:09:30 272

原创 Maximum Depth of Binary Tree——Difficulty:Easy

Problem :Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Example:**Algorithm:** 水题水一下。。。**

2016-12-20 14:20:18 278

原创 House Robber III——Difficulty:Medium

Problem :The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. Afte

2016-12-20 14:15:53 283

原创 Maximum Subarray——Difficulty:Medium

Problem :Find the contiguous subarray within an array (containing at least one number) which has the largest sum.Example:For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4

2016-12-19 15:38:43 221

原创 Burst Balloons——Difficulty:Hard

Problem :Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get

2016-12-19 14:51:04 239

原创 8.16

烹调实验: 输入:可选材料的n:n*n的矩阵D:某个值p>=0 输出:使得负面影响值不超过P最大材料数量 证明:如果烹调实验多项式时间内可解,那么3SAT也能。 思路: 如果3SAT多项式时间内不可解,独立集同样在多项式时间内不可解(书上例题已证),那么烹调实验(EXPERIMENTAL CUISINE)也不可解(待会证明),由逆否命题可得,如果烹调实验在多

2016-11-20 20:42:57 387

原创 Integer Break——Difficulty:Medium

Problem :Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.Example:For example, give

2016-11-14 15:54:06 250

原创 Count Numbers with Unique Digits——Difficulty:Medium

Problem :Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n.Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x < 100,

2016-11-14 15:22:08 291

原创 Split Array Largest Sum——Difficulty:Hard

Problem :Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among the

2016-10-17 20:51:21 400 2

原创 Arithmetic Slices——Difficulty:Memium

Problem :A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.Example:For example, these are arithm

2016-10-17 19:00:56 327

原创 Symmetric Tree(递归和非递归方法) ——Difficulty:Easy

Problem :Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).Example:For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3

2016-10-10 22:24:22 328

原创 Binary Tree Zigzag Level Order Traversal——Difficulty:Medium

Problem :Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate between).Example:For example:Gi

2016-10-10 20:51:26 230

原创 Remove Invalid Parentheses——Difficulty:Hard

Problem :Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may contain letters other than the parentheses ( an

2016-10-10 19:10:46 366 1

翻译 MPI编程函数接口(C/C++)

话说MPICH2貌似最多只能支持10000个处理器啊,可是作业里要好多好多个,怎么办。。//参考教程:http://mpitutorial.com/tutorials/MPI_Init( int* argc, char*** argv)MPI_Comm_size( MPI_Comm communicator, int* size)MPI_Comm_rank(

2016-09-26 15:08:08 2546 2

原创 Convert Sorted Array to Binary Search Tree——Difficulty:Medium

Problem :Given an array where elements are sorted in ascending order, convert it to a height balanced BST.Example:**Algorithm:** 根据二叉平衡搜索树的特点,因为这个数组是有序的,所以可以把数组分成两半,左边一半世左子树,右边一半是右子树,中间的是根节点,然后对每一半的数组

2016-09-21 16:38:17 498

原创 Kth Smallest Element in a BST——Difficulty:Medium

Problem :Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST’s total elements.Follow up: What if the B

2016-09-21 16:14:26 222

原创 Majority Element——Difficulty:Easy

Problem :Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority elemen

2016-09-12 16:07:34 264

原创 Merge k Sorted Lists——Difficulty:Hard

Problem :Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:**Algorithm:** 通过两个list的归并在推出多个lists的归并,两个list归并是下列代码的mergeTwoLists()函数。做法是: 取任

2016-09-11 19:30:21 309 1

原创 Kth Largest Element in an Array——Difficulty:Medium

Problem :Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.Example:Given [3,2,1,5,6,4] and k = 2, return 5.Not

2016-09-11 17:49:38 341

原创 Construct Binary Tree from Inorder and Postorder Traversal——Difficulty:Medium

Problem :Given inorder and postorder traversal of a tree, construct the binary tree.Example:**Algorithm:** 已知的二叉树的中序遍历和后序遍历,构造二叉树。 图1 以图1为例, 中序遍历:DBEAFC 后序遍历:DEBFCA 可以发现后序遍历的最后一个节点是根节点,而在中序遍历中,这个

2016-09-06 13:14:41 323 1

原创 Counting Bits——Difficulty:Medium

Problem :Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example:For `num =

2016-09-04 16:44:05 242 1

原创 Nim Game——Difficulty:Easy

Problem :You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone wil

2016-09-04 15:57:51 577 1

原创 Find the difference——Difficulty:Easy

Problem :Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that w

2016-09-04 15:38:34 684 2

空空如也

空空如也

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

TA关注的人

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