ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1346. Intervals of Monotonicity

JTim If you have WA#21 [5] // Problem 1346. Intervals of Monotonicity 30 Sep 2007 01:56
input:
-3 3
2 2 1 2 2 1
output:
2
Grigor Gevorgian Re: If you have WA#21 [4] // Problem 1346. Intervals of Monotonicity 13 Jun 2008 14:43
your test is wrong 'cause A must be >=0
alexey saybel Re: If you have WA#21 [3] // Problem 1346. Intervals of Monotonicity 12 Feb 2010 15:09
This tests can help you:

1 3
2 2 1 2 2 1
1

1 3
1 1 2 2 2 1
1
... Re: If you have WA#21 [2] // Problem 1346. Intervals of Monotonicity 9 Mar 2010 21:39
alexey saybel wrote 12 February 2010 15:09
This tests can help you:

1 3
2 2 1 2 2 1
1

1 3
1 1 2 2 2 1
1
I think, that your test's are not correct.Second line must contain f(1),f(2),f(3) and no more.
... Re: If you have WA#21 [1] // Problem 1346. Intervals of Monotonicity 9 Mar 2010 23:39
Try tests:

1 9
1 2 1 2 3 2 1 2 1
4

1 10
1 2 1 2 1 0 1 2 1 2
5

1 7
1 2 1 2 1 0 1
5

My solution is greedy. One boolean, one counter and list of nonrecurring array of numbers, but i think, that we can work with numbers during reading.
Nice problem :)
Artem Khizha [DNU] Re: If you have WA#21 // Problem 1346. Intervals of Monotonicity 10 Aug 2010 14:30
> 1 7
> 1 2 1 2 1 0 1
> 5
How can that be true? (1, 2), (1, 2), (1, 0), (1) - this means, that answer should be 4.