码迷,mamicode.com
首页 >  
搜索关键字:smallest    ( 560个结果
通过遍历而非排序求最值 python list in 时间复杂度 列表元素存在性
Write a function: def solution(A) that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in ...
分类:编程语言   时间:2019-07-08 10:41:54    阅读次数:338
leetcode [402]Remove K Digits
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l ...
分类:其他好文   时间:2019-06-15 15:43:20    阅读次数:104
【leetcode】1081. Smallest Subsequence of Distinct Characters
题目如下: Return the lexicographically smallest subsequence of text that contains all the distinct characters of text exactly once. Example 1: Example 2: ...
分类:其他好文   时间:2019-06-15 10:09:22    阅读次数:108
leetcode1080
找到一个跟我的思路比较接近的参考解决方案: 参考:https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/discuss/308222/show-my-thinking-process ...
分类:其他好文   时间:2019-06-09 22:25:27    阅读次数:136
leetcode 378. Kth Smallest Element in a Sorted Matrix
二分查找 区间长度为[mn, mx] 然后O(n) 求出 & v, int k) { int len = v.size(); if(k = k) ans = m, r = m 1; else l = m+1; } return ans; } int count(vector & v, int m) ...
分类:其他好文   时间:2019-06-08 15:06:03    阅读次数:102
Binary Tree - Divide Conquer & Traverse
902. Kth Smallest Element in a BST https://www.lintcode.com/problem/kth-smallest-element-in-a-bst/description?_from=ladder&&fromId=1 578. Lowest Commo ...
分类:其他好文   时间:2019-05-25 09:20:14    阅读次数:139
The Preliminary Contest for ICPC China Nanchang National Invitational I题
Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the interval, multiplied by the smallest value ...
分类:其他好文   时间:2019-04-21 20:18:05    阅读次数:152
Leetcode 1015. Smallest Integer Divisible by K
思路显然是暴力枚举. 但是两个问题: 1.当1的位数非常大时,模运算很费时间,会超时. 其实每次不用完全用'11111...'来%K,上一次的余数*10+1后再%K就行. 证明: 令f(n)=111111...(n个1); g(n)=f(n)%K 因为f(n)=f(n-1)*10+1 所以f(n)% ...
分类:其他好文   时间:2019-04-12 23:07:43    阅读次数:242
Project Euler 5
Problem 5 Problem 5 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest po ...
分类:其他好文   时间:2019-04-02 17:06:58    阅读次数:104
230. Kth Smallest Element in a BST
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 ...
分类:其他好文   时间:2019-03-31 14:07:00    阅读次数:132
560条   上一页 1 ... 6 7 8 9 10 ... 56 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!