Maximum sum
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 33363
Accepted: 10330
Description
Given a set of n integers: A={a1, a2,..., an}, we define a...
分类:
其他好文 时间:
2014-08-06 11:59:41
阅读次数:
186
在利用张乐博士的最大熵模型工具包(Maximum Entropy Modeling Toolkit for Python and C++)和条件随机场的经典工具包CRF++(CRF++: Yet Another CRF toolkit)进行分词的时候,发现工具包不能正常安装,从报出的错误推测是gcc的版本较低,上述工具包发布于2011年,推测使用了较新的C++11标准。我们知道C++11标准开始支...
分类:
其他好文 时间:
2014-08-06 01:59:30
阅读次数:
151
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2014-08-05 22:37:50
阅读次数:
188
题目原文:
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of
S is 1000, and there exists one unique longest palindromic substring.
题意解析:
最长回文子串。就是...
分类:
其他好文 时间:
2014-08-05 15:56:59
阅读次数:
290
<!DOCTYPEhtml>
<html>
<head>
<metacharset="utf-8">
<metaname="viewport"content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=yes">
<title>TOUCH</title>
<styletype="text/css">
*{
margin:..
分类:
其他好文 时间:
2014-08-05 14:26:11
阅读次数:
275
题目链接题意 : 一个m面的骰子,掷n次,问得到最大值的期望。思路 : 数学期望,离散时的公式是E(X) = X1*p(X1) + X2*p(X2) + …… + Xn*p(Xn)p(xi)的是所有最大值是xi的情况数/总情况数一共是m^n种,掷n次,所有最大值是xi的情况数应该是xi^n,但是这里...
分类:
其他好文 时间:
2014-08-05 10:44:59
阅读次数:
217
题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lo....
分类:
编程语言 时间:
2014-08-04 04:10:26
阅读次数:
374
HDU 4002 Find the maximum(数论-欧拉函数)
题目大意:
给定一个n,问你1~n中,求一个数 x 使得 x/φ(x) 的值最大。
解题思路:
根据欧拉函数的公式,φ(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…..(1-1/pn)
则:x/φ(x)=p1/(p1-1)*p2/(p2-1)*......*pn/(pn-1)
可以看出项越多x/φ(x)越大,且因子越小x/φ(x)越大,那么只需要2*3*5*7....
考虑到数字很大,所以用JAVA来写...
分类:
其他好文 时间:
2014-08-03 23:16:46
阅读次数:
268
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
/**
* Definition for binary tree
...
分类:
其他好文 时间:
2014-08-02 23:32:04
阅读次数:
232
Delay Constrained Maximum Capacity Path
Time Limit:10000MS Memory Limit:65535KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
Consider an undirected graph with N vert...
分类:
其他好文 时间:
2014-08-02 18:31:43
阅读次数:
313