这道题要求的一个min和一个max,只是这个min所在的位置要在max所在位置的左边。有一种做法是采用蛮力算法,也就是通过从左往右遍历,把每一个元素都当做min,然后再在这个元素的右边找一个最大值,这样得到一个profit,最后求得所有情况中profit的最大值即刻。但是这种做法的时间复杂度是O(n...
分类:
其他好文 时间:
2014-05-01 10:17:20
阅读次数:
287
??
Best Cow Line
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8579
Accepted: 2629
Description
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the a...
分类:
其他好文 时间:
2014-04-29 13:48:21
阅读次数:
358
Pat1063代码
题目描述:
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets,
and Nt is the to...
分类:
其他好文 时间:
2014-04-29 13:44:20
阅读次数:
325
1、
??
String to Integer (atoi)
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yours...
分类:
其他好文 时间:
2014-04-29 13:22:22
阅读次数:
341
Spark on yarn执行流程源代码分析
目前的分析主要基于spark0.9.0的cdh5的版本进行分析,
源代码下载地址:https://github.com/cloudera/spark.git
下载方式:gitclone url ./spark
进入spark目录,执行gitcheckout
cdh5-0.9.0_5.0.0
源代码编译
使用sbt编译spa...
分类:
其他好文 时间:
2014-04-29 13:13:22
阅读次数:
446
Mrs Little likes digits most of all. Every year she tries to make the best number of the year. She tries to become more and more intelligent and every year studies a new digit. And the number she make...
分类:
其他好文 时间:
2014-04-29 13:13:21
阅读次数:
309
Hello World!My first blog! I must try my best
to learn Python!print ("Hello World")
分类:
其他好文 时间:
2014-04-29 09:41:46
阅读次数:
300
题目描述
Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous ACMers there.
C...
分类:
其他好文 时间:
2014-04-28 10:33:40
阅读次数:
340