public static int MaxValue(int m, ArrayList<Integer> list) {         int start = 0;         int index = start;         for (; index < m; index++) {             if (index >= list.size()) {                 break;             }             if (list.get(index) > 0) {                 m += list.get(index);                 m -= (index - start);                 start = index;             }         }         if (index >= list.size()) {             return m;         } else {             return -1;         }     } 不知道对不对,没有oj能测试了
点赞 评论

相关推荐

昨天 13:52
武汉大学 golang
点赞 评论 收藏
分享
05-29 09:02
门头沟学院 Java
点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务