摘要:
N个数到一个数的距离和最小。这个数一定是他们的中位数。 dp[i][j]=前i个点,j个office的距离。 dp[i][j]=min(dp[k-1][j-1]+w[k][i]) w[k][i]是k..i 修一个office的距离。 Post Office Time Limit: 1000MS Me 阅读全文
摘要:
有时候,类和方法须要对类型变量加以约束。比方你有一个方法,你仅仅希望它接收某个特定类型及其子类型作为參数。 以下就举一个方法限定接收參数的类型的样例来说明怎样限定类型变量。 首先有几个简单的辅助类: package generic; public class Person extends Anima 阅读全文
摘要:
Smith Numbers Background While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University , noticed that the telephon 阅读全文