1. Question: 667. Beautiful Arrangement II https://leetcode.com/problems/beautiful-arrangement-ii/ Given two integers n and k, you need to construct a ...
分类:
其他好文 时间:
2018-11-22 02:45:58
阅读次数:
331
首先想到的肯定是暴力解法,O(n^2)。 421ms,8.51%,肯定不行,思考更优解法。 自己想到了two pointer,但是没有彻底想明白,看了solution后明白了。 6ms,66.7%,O(n)。和3ms答案基本一个思路了,可以了。 ...
分类:
其他好文 时间:
2018-11-21 22:15:08
阅读次数:
177
https://leetcode.com/problems/median-of-two-sorted-arrays/ There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median o ...
分类:
其他好文 时间:
2018-11-21 16:19:30
阅读次数:
130
Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2] Example 2: Input: num ...
分类:
编程语言 时间:
2018-11-21 16:12:27
阅读次数:
149
#include int main() { int n; int i; int mny[200]; int hund,fifty,ten,five,two,one; int total; while(~scanf("%d",&n)) { total =0; if(n==0) break... ...
分类:
其他好文 时间:
2018-11-20 23:10:06
阅读次数:
152
莫队实际很简(du)单(liu) 依照某位dalao的说法,就是两只小手(two pointers)瞎跳 莫队 我们以 "Luogu P3901 数列找不同" 为例讲一下静态莫队 这道题是个绿题,因为数据比较弱,但真是一道良心的莫队练手题 莫队是由前国家队队长莫涛发明的 莫队算法的精髓就是通过合理地 ...
分类:
其他好文 时间:
2018-11-20 21:45:54
阅读次数:
231
https://leetcode.com/problems/divide-two-integers/ Given two integers dividend and divisor, divide two integers without using multiplication, division ...
分类:
其他好文 时间:
2018-11-20 00:08:49
阅读次数:
140
pcl之basic usage + width (int) two meanings: 1. it can specify the total number of points in the cloud for unorganized point cloud datasets; 2. it can ...
分类:
其他好文 时间:
2018-11-20 00:07:54
阅读次数:
190
1. Question: 167. Two Sum II - Input array is sorted url : https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ Given an array of integers ...
分类:
其他好文 时间:
2018-11-20 00:02:17
阅读次数:
189
https://leetcode.com/problems/two-sum/description/ ...
分类:
其他好文 时间:
2018-11-19 14:09:19
阅读次数:
152