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

16324번 - Jumbled String 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB242757231.858%

문제

Recall that a subsequence of a string is any string obtained by removing some subset of characters from the string, for instance “string”, “sing”, “i” and “sg” are all subsequences of “string”. If the same subsequence can be obtained in exactly t different ways, by removing different subsets of characters, we say that the subsequence occurs t times.

Jingfei wants to create a nonempty bit string that has the following properties:

  1. the subsequence 00 occurs a times,
  2. the subsequence 01 occurs b times,
  3. the subsequence 10 occurs c times, and
  4. the subsequence 11 occurs d times.

However, Jingfei does not know how to create such a string – or whether it is even possible. Could you help her?

입력

The input consists of a single line with four integers a, b, c, and d (0 ≤ a, b, c, d ≤ 109).

출력

Output a bit string that satisfies the given requirements. If there are several solutions, output any one of them. If there are no solutions, output “impossible”.

제한

예제 입력 1

3 4 2 1

예제 출력 1

01001

예제 입력 2

5 0 0 5

예제 출력 2

impossible

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2018 J번

  • 문제를 만든 사람: Antti Laaksonen
(追記) (追記ここまで)

출처

대학교 대회

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

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