博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
01-2. Maximum Subsequence Sum (25)
阅读量:7084 次
发布时间:2019-06-28

本文共 464 字,大约阅读时间需要 1 分钟。

#include
#include
int main(){ int k,i; int *a; while(scanf("%d",&k)!=EOF) { int sum=0,b=0; int f=0,l=k,t=0; a=(int *)malloc(k*sizeof(int)); for(i=0;i
0) b+=a[i]; else { b=a[i]; t=i; } if(b>sum) { sum=b; l=i; } if(t<=l&&l!=k) f=t; } if(l==k) l--; printf("%d %d %d\n",sum,a[f],a[l]); } return 0;}

很悲催,不能全部通过。能通过有一个测试点无法通过!代码还是乱糟糟的!!

转载于:https://www.cnblogs.com/abc-24990/p/4257520.html

你可能感兴趣的文章
我的友情链接
查看>>
mysql批量insert
查看>>
位图图像处理控件ImageCapture Suite更新至v9.1
查看>>
Oracle常用命令
查看>>
我的友情链接
查看>>
spring 工具类简介02
查看>>
I/O基础理论
查看>>
大型网站技术架构的演进
查看>>
使用Apache Tiles3.x构建界面布局(二)
查看>>
iOS APP发布经验(Xcode6.2 2015.3不断更新)
查看>>
coredata数据库模型复制
查看>>
Django 信号处理
查看>>
Linux加载光驱优盘
查看>>
Wireshark抓包工具使用教程以及常用抓包规则
查看>>
MySQL案例分享之系统消息
查看>>
Spring Security简介
查看>>
PCRE配置共享库
查看>>
find使用方法(筆記)
查看>>
系统管理命令watch
查看>>
symantec运行报错及解决汇总
查看>>