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

33140번 - Finding Privacy 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 (추가 시간 없음) 2048 MB50322672.222%

문제

You surely agree that the best place to use a restroom is at home. However, sometimes people have no choice but to use a public restroom, where toilets are often arranged side by side in a single row. Aiming for some privacy, each person who enters such restroom will choose an unoccupied toilet that has no occupied toilets on its sides.

Suppose that $K$ people arrive at a public restroom with $N$ initially unoccupied toilets arranged in a row. Determine if it’s possible that each of the $K$ people chooses a toilet with no occupied toilets on its sides, and an additional person would not be able to find an unoccupied toilet meeting this privacy condition. People choose toilets one by one, and each chosen toilet is immediately occupied before the next person is allowed to choose.

입력

The input consists of a single line that contains two integers $K$ and $N$ (1ドル ≤ K ≤ N ≤ 10^6$), indicating respectively the number of people and the number of toilets.

출력

Output a single line with a string of length $N$ if the $K$ people can choose toilets in a way that prevents an additional person from finding an available toilet with the required privacy. In this case the $i$-th character of the string must be the uppercase letter “X” if the $i$-th toilet is chosen, and the character “-” (hyphen) otherwise. Toilets are chosen as it is described in the statement. If there are multiple solutions, output any of them.

If toilets cannot be chosen as requested, output a line with the character “*” (asterisk) instead.

제한

예제 입력 1

1 5

예제 출력 1

*

예제 입력 2

2 5

예제 출력 2

-X-X-

예제 입력 3

3 5

예제 출력 3

X-X-X

예제 입력 4

4 5

예제 출력 4

*

예제 입력 5

5 5

예제 출력 5

*

예제 입력 6

2 5

예제 출력 6

-X--X

힌트

출처

ICPC > Regionals > Latin America > Latin America Regional Contests > Latin America Regional Contests 2024 F번

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

출처

대학교 대회

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

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