上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页
摘要: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = , You should return the followi 阅读全文
posted @ 2017-04-06 17:09 aiterator 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given a set of non overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initia 阅读全文
posted @ 2017-04-06 16:45 aiterator 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 描述 一只木桶能盛多少水,并不取决于桶壁上最高的那块木板,而恰恰取决于桶壁上最短的那块。 已知一个木桶的桶壁由N块木板组成,第i块木板的长度为Ai。 现在小Hi有一个快捷修补工具,每次可以使用修补工具将连续的不超过L块木板提高至任意高度。 已知修补工具一共可以使用M次(M L using names 阅读全文
posted @ 2017-04-06 15:20 aiterator 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, merge all overlapping intervals. For example, Given , , , , return , , . + 按开始位置大小排序 + 循环数组;如果当前区间的开始位置大于上一个区间的结束位置,将 阅读全文
posted @ 2017-04-06 13:37 aiterator 阅读(84) 评论(0) 推荐(0) 编辑
摘要: A 整除的尾数 + 枚举一下后两位数。 代码: C++ include using namespace std; int main() { int x, y, w, n; while(scanf("%d%d%d%d", &x, &y, &w, &n) != EOF) { int res = x / 阅读全文
posted @ 2017-04-05 21:02 aiterator 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Given an array of non negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
posted @ 2017-04-05 11:50 aiterator 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix: [ [ 阅读全文
posted @ 2017-04-05 11:35 aiterator 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array , the contiguous 阅读全文
posted @ 2017-04-04 21:31 aiterator 阅读(75) 评论(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 all 阅读全文
posted @ 2017-04-04 21:25 aiterator 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Follow up for N Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 上一题,稍微修改一下就可以了。 C++ class 阅读全文
posted @ 2017-04-04 21:25 aiterator 阅读(100) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页