03 2018 档案
摘要:memset()函数原型是extern void *memset(void *buffer, int c, int count) buffer:为指针或是数组, c:是赋给buffer的值, count:是buffer的长度. 这个函数在socket中多用于清空数组.如:原型是memset(buff
阅读全文
摘要:#include using namespace std; int gcd(int a,int b) { int r; while(b>0) { r=a%b; a=b; b=r; } return a; } int main() { int a,b; while(scanf("%d%d",...
阅读全文
摘要:Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2
阅读全文
摘要:Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走
阅读全文
摘要:Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, an
阅读全文
摘要:Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uni
阅读全文
摘要:什么是最长上升子序列,最长上升子序列就是在一段数字中最长按严格递增数列,不一定要连续 最长上升子序列有3种解法,但后面两种的时间复杂度都是nlogn,所以只列出其中比较常用的一种 而另一种就是用动态规划来做。 第一种,永远dp来做: 例如给出了2 5 3 4 1 7 6这了一段数字,这段数字存在了a
阅读全文

浙公网安备 33010602011771号