旅游路线 解题报告
2011-11-04 22:36
176 查看
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
var a,sum,f:array[0..100,0..100] of longint; n,m,i,j,k,ans,max:longint; begin readln(n,m); for i:=1 to n do begin for j:=1 to m do begin read(a[i,j]); sum[i,j]:=sum[i,j-1]+a[i,j]; end; readln; end; for i:=1 to m do for j:=i to m do begin ans:=0; for k:=1 to n do begin inc(ans,sum[k,j]-sum[k,i-1]); if ans>max then max:=ans; if ans<0 then ans:=0; end; end; writeln(max); end.
相关文章推荐
- NOI1994 最佳旅游路线 解题报告
- hhu 5177 旅游路线 floyd 解题报告
- NOIP 2001 Car的旅行路线 解题报告
- [Vijos1149]驾车旅游解题报告
- 【观光旅游】解题报告
- Leetcode 91. Decode Ways 路线解析 解题报告
- 舒适的路线(SPFA)解题报告
- codevs 1001 舒适的路线 解题报告 (枚举+并查集)
- codevs 1001 舒适的路线 玄学方法 解题报告
- joj 1031 Hanoi Tower Troubles Again!解题报告
- POJ-1005 I Think I Need a Houseboat解题报告
- POJ 1005 解题报告
- YT04-贪心课堂练习-1005—Wooden Sticks-(6.14日-烟台大学ACM预备队解题报告)
- Leetcode #25 Reverse Nodes in k-Group K区间链表交换 解题报告
- 【POJ 1664】 放苹果 解题报告
- ZOJ 3687 The Review Plan I 解题报告
- 哈理工oj-1049Jigsaw Puzzle解题报告
- [leetcode] 339. Nested List Weight Sum 解题报告
- leetcode解题报告:45. Jump Game II
- poj 1265-Area解题报告