Redian新闻
>
借人气问一下CHANEL的钱包什么价格呀
avatar
借人气问一下CHANEL的钱包什么价格呀# Fashion - 美丽时尚
s*x
1
网上找了半天也没找到。 多谢!
avatar
s*u
2
Several manuscripts will be submitted to building energy related journals (
IF from 2 to 5) soon and suggested reviewers are needed.
If you are interested, please send me your name, institution, email address
and a short description of yourself.
Thanks a lot!
avatar
N*n
3
It's been almost 30 months since Silver last visited 20/oz area. Silver
bears are trying hard to drive it down now.
avatar
S*1
4
朋友让我帮忙买香奈儿的钱包,香包不是只有店里才买得到的嘛,我也不想专门帮她跑
一趟看价格,有哪位好心的MM告知一下哈。给个价格范围也行~~谢谢啦啦啦~~
avatar
k*r
5
我写了一个,不知道可用不,先用DP找到最长subsequence的长度,complexity is O(
nlongn);
再用recursive找到所有可行解。
public static List> AllLongestIncreasingSubsequence(int[] nums
) {
int[] m = new int[nums.length + 1];
int L = 0;
for (int i = 0; i < nums.length; i++) {
int lo = 1;
int hi = L;
while (lo <= hi) {
int mid = (lo + hi) / 2;
if (nums[m[mid]] < nums[i]) lo = mid + 1;
else hi = mid - 1;
}
int newL = lo;
m[newL] = i;
if (newL > L) {
L = newL;
}
}
List> res = new ArrayList<>();
Helper(nums, L, 0, new ArrayList(), res);
return res;
}
public static void Helper(int[] nums, int len, int index, List tmp,
List> res) {
if (tmp.size() == len) {
res.add(new ArrayList(tmp));
return;
}
for (int i = index; i < nums.length; i++) {
if (tmp.size() == 0 || tmp.get(tmp.size() - 1) < nums[i]) {
tmp.add(nums[i]);
Helper(nums, len, i + 1, tmp, res);
tmp.remove(tmp.size() - 1);
}
}
}

public static void main(String[] args) {
int[] input = {2,7,1,3,10,4,5,6};
int[] res = LongestIncreasingSubsequence(input);
for (int i : res) {
System.out.print(i + ",");
}
int[] input2 = {1,6,2,7,3,8,9,10,4,5};
List> res2 = AllLongestIncreasingSubsequence(input2);
for (List l : res2) {
for (Integer i : l) {
System.out.print(i + ",");
}
System.out.println();
}
}
avatar
B*h
6
3折的那种915刀,2折760刀
avatar
s*x
7

nums
Thanks a million !!

【在 k****r 的大作中提到】
: 我写了一个,不知道可用不,先用DP找到最长subsequence的长度,complexity is O(
: nlongn);
: 再用recursive找到所有可行解。
: public static List> AllLongestIncreasingSubsequence(int[] nums
: ) {
: int[] m = new int[nums.length + 1];
: int L = 0;
: for (int i = 0; i < nums.length; i++) {
: int lo = 1;
: int hi = L;

avatar
S*1
8
谢谢MM哈,,,确实好贵额。。

【在 B*********h 的大作中提到】
: 3折的那种915刀,2折760刀
avatar
a*e
9
这个太长了,背不下来。

【在 k****r 的大作中提到】
: 我写了一个,不知道可用不,先用DP找到最长subsequence的长度,complexity is O(
: nlongn);
: 再用recursive找到所有可行解。
: public static List> AllLongestIncreasingSubsequence(int[] nums
: ) {
: int[] m = new int[nums.length + 1];
: int L = 0;
: for (int i = 0; i < nums.length; i++) {
: int lo = 1;
: int hi = L;

avatar
B*h
10

恩,还频繁涨价,所以看中就快下手吧

【在 S********1 的大作中提到】
: 谢谢MM哈,,,确实好贵额。。
avatar
k*r
11
有个main函数,觉得不能再短了:)

【在 a****e 的大作中提到】
: 这个太长了,背不下来。
avatar
S*1
12
额。。。我朋友还跟我说她要攒钱买,,,

【在 B*********h 的大作中提到】
:
: 恩,还频繁涨价,所以看中就快下手吧

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。