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

32364번 - Hat Circle 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB24517614872.906%

문제

At a recent social gathering, N people sit around a circular table, where N is even. The seats are numbered clockwise from 1 to N. Each person is wearing a hat with a number on it. Specifically, the person at seat i is wearing a hat with the number Hi on it.

Each person looks at the person who is directly across (diametrically opposite) them in the circle.

Determine the number of people who see someone with a hat with the same number as their own.

입력

The first line of input will consist of one even positive integer N, representing the number of people at the social gathering.

The next N lines each contain a single non-negative integer Hi, representing the hat number of person i.

출력

Output a single integer representing the number of people who see their hat number on the person directly across from them.

제한

서브태스크

Subtask Score Description Bounds on N Bounds on Hi
1 2 Very small number of people; only two hat numbers N ≤ 4 Hi ≤ 1
2 1 Only one hat number N ≤ 100 Hi = 1
3 2 People in even numbered seats have hat number 1; people in odd numbered seats have hat number 0 N ≤ 100 Hi ≤ 1
4 5 Medium number of people N ≤ 2 000 Hi ≤ 4 000
5 5 Large number of people and hat numbers N ≤ 1 000 000 Hi ≤ 2 000 000

예제 입력 1

4
0
1
0
1

예제 출력 1

4

The four seats around the table are shown below. Hat numbers are shown inside each seat and seat numbers are shown beside each seat. Notice that every person sees their hat number. The people in seats 1 and 3 both see hat number 0, and the people in seats 2 and 4 both see hat number 1.

예제 입력 2

4
1
0
0
1

예제 출력 2

0

The four seats around the table are shown below. Hat numbers are shown inside each seat and seat numbers are shown beside each seat. Notice that no person sees their hat number. The people in seats 1 and 4 both see hat number 0, and the people in seats 2 and 3 both see hat number 1.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2024 > CCC 2024 Senior Division 1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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