<blockquote><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by AK70:
<strong>
it should be wrong</strong><hr></blockquote>
В программировании употребление слова "should" обычно означает, что реально имеет место прямо противоположное утверждаемому [img:76d50e12cb]images/smiles/icon_smile.gif[/img:76d50e12cb] . Как и в данном случае, кстати.
Нахождение макс суммы в ряде
-
- Уже с Приветом
- Posts: 1257
- Joined: 03 Oct 2001 09:01
- Location: Valinor->Utumno->Angband
-
- Уже с Приветом
- Posts: 276
- Joined: 14 Sep 2001 09:01
- Location: Donetsk, Ukraine -> Kansas City, MO -> Seattle, WA
Нахождение макс суммы в ряде
<blockquote><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by AK70:
<strong>check this:
10,-1,100,0,1,-1,10
u see the problem yourself [img:58ed48d4fd]images/smiles/icon_smile.gif[/img:58ed48d4fd]
</strong><hr></blockquote>
Не понял. А в чем проблема? Печатает:
[10, -1, 100, 0, 1, -1, 10]
Или это не верно?
.pl
<strong>check this:
10,-1,100,0,1,-1,10
u see the problem yourself [img:58ed48d4fd]images/smiles/icon_smile.gif[/img:58ed48d4fd]
</strong><hr></blockquote>
Не понял. А в чем проблема? Печатает:
[10, -1, 100, 0, 1, -1, 10]
Или это не верно?
.pl
-
- Уже с Приветом
- Posts: 3127
- Joined: 10 Apr 2001 09:01
- Location: MD
Нахождение макс суммы в ряде
<blockquote><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by clinger:
<strong>
Не понял. А в чем проблема? Печатает:
[10, -1, 100, 0, 1, -1, 10]
Или это не верно?
.pl</strong><hr></blockquote>
well, it prints 100,0,1,-1,10 on my PC.
<strong>
Не понял. А в чем проблема? Печатает:
[10, -1, 100, 0, 1, -1, 10]
Или это не верно?
.pl</strong><hr></blockquote>
well, it prints 100,0,1,-1,10 on my PC.
-
- Уже с Приветом
- Posts: 3127
- Joined: 10 Apr 2001 09:01
- Location: MD
Нахождение макс суммы в ряде
<blockquote><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Melkor:
<strong>
В программировании употребление слова "should" обычно означает, что реально имеет место прямо противоположное утверждаемому [img:178d451283]images/smiles/icon_smile.gif[/img:178d451283] . Как и в данном случае, кстати.</strong><hr></blockquote>
intuitively, I feel that there must be a linear solution. but I didn't see it yet. which solution above is linear and correct at the same time? [img:178d451283]images/smiles/icon_smile.gif[/img:178d451283]
<strong>
В программировании употребление слова "should" обычно означает, что реально имеет место прямо противоположное утверждаемому [img:178d451283]images/smiles/icon_smile.gif[/img:178d451283] . Как и в данном случае, кстати.</strong><hr></blockquote>
intuitively, I feel that there must be a linear solution. but I didn't see it yet. which solution above is linear and correct at the same time? [img:178d451283]images/smiles/icon_smile.gif[/img:178d451283]
-
- Уже с Приветом
- Posts: 1257
- Joined: 03 Oct 2001 09:01
- Location: Valinor->Utumno->Angband
Нахождение макс суммы в ряде
<blockquote><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by AK70:
<strong>
intuitively, I feel that there must be a linear solution. but I didn't see it yet. which solution above is linear and correct at the same time? [img:a1560515b1]images/smiles/icon_smile.gif[/img:a1560515b1] </strong><hr></blockquote>
Ну, мое, например, а также clinger'a и Artem'a Borovinskih (по сути, это то же самое решение, только шаг разбиения на подмассивы неявно интегрирован в основной цикл; он, по большому счету, нужен только для исследования задачи, а при реализации его таки можно опустить).
<strong>
intuitively, I feel that there must be a linear solution. but I didn't see it yet. which solution above is linear and correct at the same time? [img:a1560515b1]images/smiles/icon_smile.gif[/img:a1560515b1] </strong><hr></blockquote>
Ну, мое, например, а также clinger'a и Artem'a Borovinskih (по сути, это то же самое решение, только шаг разбиения на подмассивы неявно интегрирован в основной цикл; он, по большому счету, нужен только для исследования задачи, а при реализации его таки можно опустить).
-
- Уже с Приветом
- Posts: 3127
- Joined: 10 Apr 2001 09:01
- Location: MD
Нахождение макс суммы в ряде
<blockquote><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by tengiz:
<strong>Uh-oh, you got angry, my friend! [img:a998810a4f]images/smiles/icon_razz.gif[/img:a998810a4f] You shouldn't have, pal - only losers get angry, right? To see the right solution, just read the thread carefully. Or at least read the classics:
Programming Pearls by Jon Louis Bentley, Addison-Wesley Pub Co; ISBN: 0201657880..</strong><hr></blockquote>
ok, I'll check that book. I didn't open it since I first read it.
and, I wasn't angry, btw [img:a998810a4f]images/smiles/icon_smile.gif[/img:a998810a4f]
<strong>Uh-oh, you got angry, my friend! [img:a998810a4f]images/smiles/icon_razz.gif[/img:a998810a4f] You shouldn't have, pal - only losers get angry, right? To see the right solution, just read the thread carefully. Or at least read the classics:
Programming Pearls by Jon Louis Bentley, Addison-Wesley Pub Co; ISBN: 0201657880..</strong><hr></blockquote>
ok, I'll check that book. I didn't open it since I first read it.
and, I wasn't angry, btw [img:a998810a4f]images/smiles/icon_smile.gif[/img:a998810a4f]
-
- Уже с Приветом
- Posts: 4468
- Joined: 21 Sep 2000 09:01
- Location: Sammamish, WA
Нахождение макс суммы в ряде
<blockquote><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by AK70:
well, I don't like bla-bla, I didn't see the right solution yet. if u have ur own, show. or shut up.<hr></blockquote>Uh-oh, you got angry, my friend! [img:901afb0277]images/smiles/icon_razz.gif[/img:901afb0277] You shouldn't have, pal - only losers get angry, right? To see the right solution, just read the thread carefully. Or at least read the classics:
Programming Pearls by Jon Louis Bentley, Addison-Wesley Pub Co; ISBN: 0201657880..
well, I don't like bla-bla, I didn't see the right solution yet. if u have ur own, show. or shut up.<hr></blockquote>Uh-oh, you got angry, my friend! [img:901afb0277]images/smiles/icon_razz.gif[/img:901afb0277] You shouldn't have, pal - only losers get angry, right? To see the right solution, just read the thread carefully. Or at least read the classics:
Programming Pearls by Jon Louis Bentley, Addison-Wesley Pub Co; ISBN: 0201657880..
-
- Уже с Приветом
- Posts: 3127
- Joined: 10 Apr 2001 09:01
- Location: MD
Нахождение макс суммы в ряде
ok, guys, there's a O(N) solution [img:02cd68f327]images/smiles/icon_smile.gif[/img:02cd68f327]
I was wrong. btw, it doesn't need the modified array with M elements
[ 15-01-2002: Message edited by: AK70 ]</p>
I was wrong. btw, it doesn't need the modified array with M elements
[ 15-01-2002: Message edited by: AK70 ]</p>