아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Team Contest

시간 제한1초메모리 제한1024 MB

요약
능력치가 1에서 10 사이인 프로그래머 N명이 있을 때, 최솟값과 최댓값의 합이 K를 초과하는 세 명 팀을 최대한 많이 만들고 그 수를 구한다.
난이도

보통10점 중 5점

유형
정렬, 그리디, 배열
정답자
아직 제출이 없습니다

문제

You are a programming coach at a university. Your university is registering several teams to participate in a programming contest. The programming contest is participated by teams of three programmers.

In your university, there are NN eligible programmers, numbered from 00 to N−1N - 1. For each ii such that 0≤i≤N−10 ≤ i ≤ N - 1, programmer ii has a skill level of L\[i]L\[i]. The skill level of a team consisting of programmer ii, jj, and kk is min⁡(L\[i],L\[j],L\[k])+max⁡(L\[i],L\[j],L\[k])\min{(L\[i],L\[j],L\[k])} + \max{(L\[i],L\[j],L\[k])}.

You want to only register teams with a skill level of strictly more than KK. Each programmer may only be assigned to at most one registered team. You want to know the maximum number of teams you can register.

제한

  • 1≤N≤100,0001 ≤ N ≤ 100\\,000
  • 1≤K≤10 1 ≤ K ≤ 10
  • 1≤L\[i]≤10 1 ≤ L\[i] ≤ 10 (for each ii such that 0≤i≤N−10 ≤ i ≤ N - 1)

예제

이 문제는 공개된 예제가 없습니다.