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

33854번 - BOI acronym 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB61131220.690%

문제

As you certainly know, BOI is an acronym for the name of the Baltic Olympiad in Informatics.

The organisers find the acronym BOI too easy to pronounce (it forms a single syllable in the English language, after all). Therefore they came up with a new acronym. In order to easily distinguish it from the other regional Olympiads (like CEOI), the new acronym still consists only of characters “B”, “O” and “I”. Additionally, “B” is strictly the most common character in the acronym. That is, there are strictly more occurrences of “B” than “O”, and there are also strictly more occurrences of “B” than “I”.

For example, acronyms “OBOIIBB” and “B” are valid, but “IBIIBB”, “BOI”, “O” and “BCB” are not.

To make things more exciting, instead of publishing it in full they have only provided some hints. Namely, for each consecutive substring of the new acronym, they gave you the number of occurrences of the most common character in this substring. Note that this character is not necessarily “B”, and also the most common character is not necessarily unique. Surprisingly, it can be proven that this information is actually enough to recover all the occurrences of “B”. Can you find them?

입력

The first line contains an integer $n$ (1ドル ≤ n ≤ 2000$), denoting the length of the new acronym.

The following $n$ lines describe the hints. The $i$-th line contains $n - i + 1$ integers $M_{i,i}, M_{i,i+1}, \dots , M_{i,n}$ (1ドル ≤ M_{l,r} ≤ n$), where $M_{l,r}$ denotes the number of occurrences of the most common character in the substring that starts at the $l$-th position and ends at the $r$-th position of the acronym. The positions are numbered from 1ドル$ to $n$.

You can assume that there exists at least one valid acronym that is consistent with the given hints.

출력

Output one line with the positions of all occurrences of “B”, in the increasing order, separated by single spaces. Each position must be an integer in the range from 1ドル$ to $n$.

제한

서브태스크

번호배점제한
111

$n ≤ 10$

212

The sought acronym contains only characters “B” and “O”.

310

The sought acronym has no two consecutive equal characters.

411

$n ≤ 40$

519

$n ≤ 500$

637

No additional constraints.

예제 입력 1

6
1 1 2 3 3 3
1 1 2 2 2
1 2 2 2
1 1 2
1 2
1

예제 출력 1

1 3 4

힌트

출처

Olympiad > Baltic Olympiad in Informatics > BOI 2025 A번

채점 및 기타 정보

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

출처

대학교 대회

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

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