Logo
(追記) (追記ここまで)

32844번 - Duel of Cards 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB42302674.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.

제한

예제 입력 1

3
2
5
4

예제 출력 1

1 2

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 2024 Southeast USA Regional Programming Contest > Division 1 D번

ICPC > Regionals > North America > Southeast USA Regional > 2024 Southeast USA Regional Programming Contest > Division 2 D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /