Vrijeme: 21:53
RAM, vidiš | RAM, look #2
Zadan je niz od
različitog prirodnog broja.
Podniz definiramo kao bilo koji niz nastao od zadanog brisanjem nekoliko članova niza (možda nijednog), pri čemu se poredak preostalih članova niza ne mijenja.
Za podniz kažemo da je rastući ako je svaki član podniza (osim prvog) veći od prethodnog, a padajući ako je svaki član podniza (osim prvog) manji od prethodnog.
Koliko iznosi najveći prirodni broj
takav da u danom nizu sigurno postoji podniz od
članova koji je ili rastući ili padajući?

Podniz definiramo kao bilo koji niz nastao od zadanog brisanjem nekoliko članova niza (možda nijednog), pri čemu se poredak preostalih članova niza ne mijenja.
Za podniz kažemo da je rastući ako je svaki član podniza (osim prvog) veći od prethodnog, a padajući ako je svaki član podniza (osim prvog) manji od prethodnog.
Koliko iznosi najveći prirodni broj


A sequence of
distinct positive integers is given.
Every sequence that can be obtained from the given sequence by deleting some (maybe zero) elements without changing the order of the remaining elements is called a subsequence.
A subsequence is said to be increasing if each element (besides the first one) is greater than the previous one and decreasing if each element (besides the first one) is less than the previous one.
Find the greatest positive integer
such that, in the given sequence, there has to exist an increasing or decreasing subsequence of
elements.

Every sequence that can be obtained from the given sequence by deleting some (maybe zero) elements without changing the order of the remaining elements is called a subsequence.
A subsequence is said to be increasing if each element (besides the first one) is greater than the previous one and decreasing if each element (besides the first one) is less than the previous one.
Find the greatest positive integer

