Best Time to Buy and Sell Stock IIISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the...
分类:
其他好文 时间:
2014-10-26 22:43:56
阅读次数:
178
这道题就是一个模拟题,所以写代码时要有清晰的思路,一开始我思路很清晰,结果由于时间原因,代码敲反了.....
题目的输入是有多组的,每一组有两行,第一行是命令,第二行是一串字符串!
所以这道题有两个操作:
当输入 1 的时候表示:将第二行所输入的命令翻译为16位2进制;
当输入 0 的时候表示:将第二行所输入的16位2进制翻译为命令;
先说下怎么将命令翻译为2进制:eg:AD...
分类:
其他好文 时间:
2014-10-26 18:29:57
阅读次数:
146
题意很简单,就是给出父母的名字,然后根据父母的名字来给孩纸取名字!
可以将此题简化为:
孩纸的名字=父亲的frist name+字符串(_small_)+母亲额frist name;
然后将孩纸的名字输出即可!...
分类:
其他好文 时间:
2014-10-26 17:00:58
阅读次数:
154
参考:http://en.wikipedia.org/wiki/Discounted_cumulative_gainNormalized Discounted Cumulative Gain:一种对搜索引擎或相关程序有效性的度量。2个假设: 1.强相关的文档出现在结果列表越靠前(rank越高)越有....
分类:
其他好文 时间:
2014-10-25 22:43:13
阅读次数:
341
Problem Description
After coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does no...
分类:
其他好文 时间:
2014-10-24 13:01:58
阅读次数:
279
In cases like this, where the independent variable does not have an intrinsic ordering, it isoften a good idea to sort entries by the dependent variab...
分类:
其他好文 时间:
2014-10-24 12:32:15
阅读次数:
233
Best Time to Buy and Sell Stock IISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the ...
分类:
其他好文 时间:
2014-10-23 12:23:23
阅读次数:
224
1 #include "stdio.h" 2 #define maxn 20010 3 4 int wa[maxn],wb[maxn],wv[maxn],ws[maxn]; 5 int rank[maxn],height[maxn]; 6 int r[maxn],sa[maxn],ans[max.....
分类:
编程语言 时间:
2014-10-23 12:20:11
阅读次数:
194
Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to compl...
分类:
其他好文 时间:
2014-10-22 21:54:00
阅读次数:
192
一、手工查询得出名次select * ,select count(*)+1 from T2 where T2.[成绩] > T1.[成绩] as 名次 from T1结果:12335二、SQL Server 2005 的排序函数 ROW_NUMBER、RANK、DENSE_RANK1.ROW_NUM...
分类:
数据库 时间:
2014-10-20 13:06:40
阅读次数:
197