#include <stdio.h> #include <stdlib.h> int main () { int b[1001]; int n; __int64 sum[1001]; //用于存放到 i 位置为止 的子序列的和 while (scanf ("%d", &n) && n) { for ( int i =0; i < n;i ++) { scanf ("%d", &b[i]); } sum[0] = b[0]; for (int i =1; i < n; i ++) //下面的处理和 grids 2757的处理思想是一样的,只不过sum 数组存的是和值 { int tempMaxsum =0; for (int j =0; j < i; j ++) //因为 i 之前的和值已经存储在了sum中, // 所以只需要找到最大的tempMaxSum后再加上 i 位置本身的值就可以了 { if (b[j] <b[i] && tempMaxsum < sum[j]) { tempMaxsum = sum[j]; } } sum[i] = tempMaxsum + b[i]; } __int64 max =-1; for (int i =0; i < n; i ++) { if (max < sum[i]) { max = sum[i]; } } printf ("%I64d\n",max); } return0; }
在使用Eclipse进行开发的时候,出现了如下的问题:
Description Resource Path Location TypeThe project was not built due to "A resource exists with a different case: '/SeenTaoImp_zhV2/bin/seentao'.&
var grid = $('#datagrid');
var options = grid.datagrid('getPager').data("pagination").options;
var curr = options.pageNumber;
var total = options.total;
var max =