上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 17 下一页
摘要: #1239 : Fibonacci #1239 : Fibonacci 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Given a sequence {an}, how many non-empty sub-sequence of it is a prefix of 阅读全文
posted @ 2016-09-11 21:40 wangxiaobao1114 阅读(399) 评论(0) 推荐(0) 编辑
摘要: #1237 : Farthest Point #1237 : Farthest Point 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 Given a circle on a two-dimentional plane. Output the integral poi 阅读全文
posted @ 2016-09-11 21:23 wangxiaobao1114 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,- 阅读全文
posted @ 2016-09-09 22:09 wangxiaobao1114 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions.(Hard) 分析: 跟昨天的题目一样的思路 阅读全文
posted @ 2016-09-09 22:06 wangxiaobao1114 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return 阅读全文
posted @ 2016-09-08 22:26 wangxiaobao1114 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目: Implement pow(x, n). (Medium) 分析: 实现库函数求幂运算,遍历一遍是超时的,用快速幂,就是分治的思想,每次把n去掉一半。 注意:n的取值范围,n = MIN_INT时,-n会超范围,这里WA了一次。 代码: 阅读全文
posted @ 2016-09-07 21:27 wangxiaobao1114 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 虚函数,虚指针(vptr)与虚函数表(vtbl) 阅读全文
posted @ 2016-09-07 20:32 wangxiaobao1114 阅读(7157) 评论(1) 推荐(1) 编辑
摘要: 题目: Implement wildcard pattern matching with support for '?' and '*'. 分析: 跟第10题Regular Expression Matching很像,从正则表达式匹配变成了通配符匹配,用动态规划的方法做的话, 比之前这个题要来的简单 阅读全文
posted @ 2016-09-06 22:04 wangxiaobao1114 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: Note: All inputs will be i 阅读全文
posted @ 2016-09-05 22:51 wangxiaobao1114 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). (Medium) Follow up:Could you do this in-place? 阅读全文
posted @ 2016-09-05 22:47 wangxiaobao1114 阅读(152) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 17 下一页