Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:Re:Re:Re:Re:Re:我靠!我也TLE了

Posted by iowakid at 2008-11-10 00:43:36 on Problem 1163
In Reply To:Re:Re:Re:Re:Re:Re:我靠!我也TLE了 Posted by:liuweni at 2007-07-24 11:23:24
program p1163(input, output); var a, b : array[1..100] of longint; n, i, j, p : integer; max : longint; begin readln(n); max := -1; fillchar(a, sizeof(a), 0); for i := 1 to n do begin fillchar(b, sizeof(b), 0); for j := 1 to i do begin read(p); if j = 1 then b[j] := a[j]+p else if j = i then b[j] := a[j-1]+p else begin if a[j]>a[j-1] then b[j] := a[j]+p else b[j] := a[j-1]+p; end; if b[j]>max then max := b[j]; end; a := b; end; writeln(max); end.

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator