| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 42 | 30 | 26 | 74.286% |
Alice and Bob are playing a card game. There are 2ドルn$ cards uniquely numbered from 1ドル$ to 2ドルn$. The cards are shuffled and dealt to the two players so that each player gets $n$ cards. Each player then arranges the cards they get into a deck in any order that they choose, facing down.
The game has $n$ turns. In each turn, both players reveal the card that is on the top of their deck and compare the numbers on the two cards. The player with the larger card wins and scores one point. This is repeated until all cards in the decks are compared.
After getting her $n$ cards, Alice wonders what is the minimum and maximum number of points she may possibly score in the game.
The first line of input contains a single integer $n$ (1ドル ≤ n ≤ 1,円 000$), the number of cards that Alice gets.
The next $n$ lines each have a single integer between 1ドル$ and 2ドルn$ (both inclusive) giving a card that is dealt to Alice. It is guaranteed that all those cards are unique.
Output two integers, the minimum and maximum number of points Alice may score.
3 2 5 4
1 2