z***2 发帖数: 66 | 1 佩服!
import java.util.*;
class train {
public static void main(String[] args) {
double table[]=new double [10001];
table[0]=3000.0;
for(int i =1; i
double localMax=-1.0;
double curDistance= i/10+ (double)(i%10)*1/10;
//System.out.println(curDistance);
for(int j=0; j
double totalLeft = table[j];
double prevDistance= j/10+ (double)(... 阅读全帖 |
|
|
b****y 发帖数: 257 | 3 That answer is wrong,
it should be
int left = maxSum(root->left, max);
int right = maxSum(root->right, max);
int sum = left + right + root->data;
int localMax = max(sum, max(left,right));
if(sum > *max)
*max = sum;
return max; |
|
|