BAT2 - BATMAN2
Alfred: "I'll get this to Mr. Fox, but no more. I've sewn you up, I've set your bones, but I won't bury you. I've buried enough members of the Wayne family."
After being promised the software to erase her criminal record, Catwoman agrees to take Batman to Bane. They manage to defeat all of Bane's men but ended up heading into a MAZE trap. Bane would call this maze as the LIS MAZE. He would hide himself in one of the rooms. Each of these rooms have a number (tag) associated with it. The speciality of the maze is that once you enter any room it will only lead you to rooms with a higher tag in the direction you move. Batman and Catwoman decide to move in opposite directions trying their luck to maximize the number of rooms they search. (They can start with any room, need not be the same)
Catwoman: "Never steal from someone you can't outrun, kid."
Input
t, number of testcases.
n, number of rooms.
n integers giving the tag associated with the rooms.
Output
The maximum number of rooms searched.
Constraints
1 ≤ n ≤ 100
Example
Input: 1 6 5 3 4 6 1 2 Output: 5
hide comments
Ahmed Malatawy:
2013-07-28 05:03:35
@Romal
|
|
Murukesh Mohanan:
2013-06-18 10:01:26
Some conditions that aren't immediately obvious to me:
|
|
Murukesh Mohanan:
2013-06-14 18:51:30
The Test case should be 4, either (3->4->6, 3->5) or (3->4->6,1). |
|
Aayush Tripathi:
2013-06-14 18:00:59
"Batman can now only move towards right and catwoman to the left"
|
|
:D:
2013-02-09 13:45:23
Seems to be ok now. Just please do not change the problem again, it's really confusing. It's better to close an old problem and open a new one. |
|
Romal Thoppilan:
2013-02-08 11:41:41
Batman can now only move towards right and catwoman to the left. |
|
himanshu jain:
2014-02-05 14:45:16
because qn has been modified Last edit: 2013-02-08 11:33:15 |
|
Ehor Nechiporenko:
2013-02-08 09:21:30
What has happened?
|
Added by: | Romal Thoppilan |
Date: | 2013-02-06 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | own problem |