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

11541번 - At most twice 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 256 MB118725862.366%

문제

Given a positive integer U, find the largest integer L such that L ≤ U and L does not contain any digit more than twice.

입력

The input consists of a single line that contains an integer U (1 ≤ U ≤ 1018).

출력

Output a line with an integer representing the largest number less than or equal to U that does not contain any digit more than twice.

제한

예제 입력 1

2210102960

예제 출력 1

2210099887

예제 입력 2

1000000000000000000

예제 출력 2

998877665544332211

예제 입력 3

1001223343

예제 출력 3

998877665

예제 입력 4

20152015

예제 출력 4

20152015

힌트

출처

ICPC > Regionals > Latin America > Latin America Regional Contests > Latin America Regional Contests 2015 A번

  • 문제를 만든 사람: Pablo Ariel Heiber
(追記) (追記ここまで)

출처

대학교 대회

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

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