Section: 1, Score: 12, Time limit per test: 30 seconds, Memory limit per test: 512MB, Input: stdin, Output: stdout
Alice is a big spender who is planning her dream trip and has found great deals on Agoda. She is looking to book a series of hotel rooms, with each room having a nightly rate. However, she wants to maximize the amount of money spent on booking the rooms in such a way that no two adjacent rooms are booked.
Given a list of integers representing the nightly rate for each hotel room, we must return the maximum amount of money Alice can spend by booking from the given rooms with the restrictions mentioned above.
The first line has N which is the number of rooms
The next N lines contain the nightly rate of each room.
An integer representing the max amount spent
5
80
70
90
100
60
230
Alice can book the rooms with rates 80, 90, and 60 for a total of 230.
5
10
3
7
1
6
23