码迷,mamicode.com
首页 >  
搜索关键字:smallest sub-array    ( 590个结果
排列专题(不定期更新)
1、POJ 2718 Smallest Difference(穷竭搜索,枚举) 题意:给出0~9之间的几个数,从给出的数中组合成两个新的整数(首位不为0),求两个数之间的差的绝对值的最小值。 思路:由于最多只有10个数,全排列枚举,前n/2个形成一个数,后面的数字形成另一个数。 1 #include ...
分类:其他好文   时间:2017-07-09 12:43:05    阅读次数:246
求最小原根 51nod 1135
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1135 代码 // the smallest primitive root of prime P #include <bits/stdc++.h> const long lo ...
分类:其他好文   时间:2017-07-01 23:25:33    阅读次数:273
230. Kth Smallest Element in a BST
https://leetcode.com/problems/kth-smallest-element-in-a-bst/#/solutions 递归: ...
分类:其他好文   时间:2017-06-30 17:18:37    阅读次数:126
[LeetCode] Minimum Factorization 最小因数分解
Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i ...
分类:其他好文   时间:2017-06-25 10:01:45    阅读次数:196
378. Kth Smallest Element in a Sorted Matrix
https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/#/solutions http://www.cnblogs.com/EdwardLiu/p/6109080.html Solution 2 : Binary ...
分类:其他好文   时间:2017-06-22 00:16:28    阅读次数:131
LeetCode Minimum Factorization
625. Minimum FactorizationGiven a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is ...
分类:其他好文   时间:2017-06-20 01:03:45    阅读次数:303
[leetcode-625-Minimum Factorization]
Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i ...
分类:其他好文   时间:2017-06-18 14:20:38    阅读次数:193
vector、set 练习 k-th divisor
k-th divisor You are given two integers n and k. Find k-th smallest divisor of n, or report that it doesn't exist. Divisor of n is any such natural nu ...
分类:其他好文   时间:2017-06-18 13:15:19    阅读次数:212
[Leetcode] Binary search/tree-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 ...
分类:其他好文   时间:2017-06-12 00:42:23    阅读次数:175
ZOJ 2112 Dynamic Rankings(带修改的区间第K大,分块+二分搜索+二分答案)
The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the k-th smallest num ...
分类:其他好文   时间:2017-06-10 21:29:19    阅读次数:179
590条   上一页 1 ... 22 23 24 25 26 ... 59 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!