Show all threads Hide all threads Show all messages Hide all messages |
Нет теста на одно отрицательное число... | vtalgo21_gsavon | 1296. Hyperjump | 17 Mar 2021 02:24 | 2 |
По условию, при входных n = 1 и единственном отрицательном значении ответ должен быть 0, но accepted получается и при неправильном решении такого теста... Либо я чего-то не понимаю... The test was added. Thank you. |
WA #4 | Shree | 1296. Hyperjump | 8 Jun 2020 01:03 | 4 |
WA #4 Shree 23 Jan 2013 17:49 Hi guys, any ideas on test #4? getting WA there один из элементов и есть максимальное значение 3 -5 90 -20 работает и при таком вводе |
O(n) | 0blivium | 1296. Hyperjump | 16 Sep 2019 02:37 | 2 |
O(n) 0blivium 4 Jan 2019 02:58 Note, the required algorithm is known as the Kadane's algorithm and runs in O(n). |
В чем прикол? | AdiZer0 | 1296. Hyperjump | 18 Mar 2019 18:40 | 2 |
Я написал рекурсию которая каждый раз делила отрезок на два и брала максимальный среди ответа всех таких отрезков которых поделила.(типо Merge Sort). У меня был memory limit на 3 тесте. Это значить рекурсия берет память? Да, берёт. Рекурсия хранит итерации в стеке. |
help! WA9 | Egor Stepanov [mikroz] | 1296. Hyperjump | 3 Dec 2015 10:01 | 3 |
help! WA9 Egor Stepanov [mikroz] 28 Oct 2008 03:52 I can't understand why. Can anybody help me? Try these two tests: 5 10 -5 3 -1 15 ---- 5 15 -1 3 -5 10 In both right answer is 22. |
Please ! Need help..my algoritm is wright, but ! WA9 | gippotalamus | 1296. Hyperjump | 3 Dec 2015 09:58 | 3 |
> > i found my mistake Edited by author 20.11.2005 00:44 I have wa#9 but I can't found mistake :( what is test 9? |
To everyone : Algorithm to solve this problem ! Very easy ! | Phan Hoài Nam - Đại học Ngoại ngữ Tin Học TP.HCM | 1296. Hyperjump | 18 Jan 2012 20:58 | 4 |
calculate : fmax(n) = max(fmax(n-1)+value(n),value(n)); Why? Consider p1 = 5, p2 = -2 fmax(1) = 5 fmax(2) = max( 5+(-2), -2 ) = 3 But if i = j = 1 fmax(2) = 5 Or I got wrong understanding of the task? F[i] is max values of sequence with the final element is a[i]. Finally, answer will be max( F[1], ... F[n] ). Sorry because of English. It's wrong algorithm and more hard than right. |
How do better? (my solution 0.031 208kb) | Ont | 1296. Hyperjump | 3 Aug 2011 16:44 | 4 |
Best solution - 0.015. How to improve? I do not use array. Only 5 vars - (3 integer and 2 longint) I use inc([longint], number) instead of [longint]:= [longint] + number; Edited by author 07.02.2008 18:14 my solution is also 0.031 and I used same "vars" as you and no array. my algo if O(N). and what is most interesting, one time the result was 0.015! after it i send same solution. it was 0.031 again. Edited by author 07.02.2008 18:15 I have 4 int vars, O(N) algo. I solved it 5 times already, and still (0.031,108). Useless. |
Secod demonstration test | D_T_F | 1296. Hyperjump | 3 Aug 2011 15:57 | 2 |
No more question. I read the text badly. Edited by author 23.03.2009 03:56 I got it too. Sorry for this post ^^ For anyone who can't understand this example: remember that the first number means the size of a sequence given, not the first its element! Edited by author 03.08.2011 16:16 |
C# - AC | Varun Sharma | 1296. Hyperjump | 5 May 2009 11:26 | 1 |
C# - AC Varun Sharma 5 May 2009 11:26 Hi, Well, the only thing to keep in mind for this problem is that final answer cannot be negative. If it comes to negative then output 0. Secondly, just start adding the numbers from the beginning and keep track of the maximum sum. For example, if you add first three terms and sum comes to 500 and then the fourth term is -500, then don't loose the previous 500 sum. Keep it somewhere, but make your new sum 0. Then start adding from 5th term (0 + 5th term + ....). Whenever you add just check whether the new one is greater than 500 or not ? If it is then replace it with that. Varun Edited by author 05.05.2009 11:30 Edited by author 05.05.2009 11:31 |
YES!!! I got AC!!! | I am get tester... | 1296. Hyperjump | 7 Feb 2008 18:06 | 5 |
time 0.046 memory 906 КБ (wow!!!) O(N) = (N * log N) It isn't cool, 'cause the normal (and simple) solution is O(N),not O(N * log N). I got AC 0.015 165 kb O(N) Edited by author 13.08.2005 20:17 AC 0.015, 104 kb Memory :) |
A faster solution | Darth Niculus(Ivan Nicolae) | 1296. Hyperjump | 17 Apr 2007 22:09 | 3 |
Is there a faster solution that the one with 3 for's. I would apreciate if there is one. Yes, using dynamic programming (i use this method and stuck at WA 7) |
I have TLE... Help... | Neo Nomaly | 1296. Hyperjump | 12 Apr 2005 17:10 | 2 |
This is finding maxinmum sum in p array... I have TLE on test #13... Help... procedure solve; var i,j:longint; begin a[1]:=p[1]; max:=a[1]; for i:=2 to n do begin a[i]:=p[i]+a[i-1]; if max<a[i] then max:=a[i]; end; for i:=1 to n do for j:=i to n do if max<a[j]-a[i]+p[i] then max:=a[j]-a[i]+p[i]; end; This can be done in O(N), yours is O(N²) |
Problem??? | sokol | 1296. Hyperjump | 10 Jun 2004 12:14 | 3 |
For example: If N=3 and p1=3; p2=-3; p3=10; What i and j = ? How can you calculate i and j? |
1296 | andrew | 1296. Hyperjump | 21 Apr 2004 15:13 | 2 |
1296 andrew 21 Apr 2004 14:54 Can anybody answer my question? May numbers i and j be equal during the jump and what shall we do if n=0? I suggest that i and j CAN be equal, for example if N=3, intensity is -1,2,-1, then both i and j are 2, and NO, N cannot be zero. |