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

6972번 - Double Knockout Competition 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB117171618.391%

문제

In a number of sports, a championship may be determined by a double knockout competition. A team is eliminated on its second loss, so the winner is the last remaining team with one or fewer losses. The competition is played is a series of rounds: in each round, teams that have not been eliminated are paired subject to the constraint that an undefeated team never plays a team with one loss. As many teams as possible are paired in each round. After a number of rounds only two teams remain. These teams play in a round by themselves, although one is undefeated and the other is not. If neither is eliminated, they play again in a final round. For our analysis we assume that this extra round is always necessary.

Write a program to report on a Double Knockout Competition.

입력

The first line of input contains one positive integer n which is the number of test cases which follow it. The next n lines each contain one positive integer t, t < 32768, which is the number of teams in the competition for that test case.

출력

For each case there should be an initial line which has the form: Round 0:

2 undefeated, 0 one-loss, 0 eliminated

This is followed by a similar line for each round of the competition, followed by a single line saying how my rounds were played. The output for different test cases is to be separated by a single blank line.

제한

예제 입력 1

1
2

예제 출력 1

Round 0: 2 undefeated, 0 one-loss, 0 eliminated
Round 1: 1 undefeated, 1 one-loss, 0 eliminated
Round 2: 0 undefeated, 2 one-loss, 0 eliminated
Round 3: 0 undefeated, 1 one-loss, 1 eliminated
There are 3 rounds

힌트

And,

b) If there are t = 2^(2^k) teams, where k is an integer, how many rounds are played in the tournament?

c) How many games are played in an t team competition?

출처

Olympiad > Canadian Computing Competition & Olympiad > 1997 > CCC 1997 3번

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

출처

대학교 대회

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

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