시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB110181252.174%

문제

숫자로 이루어진 문자열이 있다. 이 숫자를 적절히 나누어서 증가수열을 만들고자 한다. 예를 들어 3546을 나눈다면 3,5,46 또는 35,46으로 나눌 수 있다. 이 증가수열 중 마지막 숫자를 가장 작게 하려 할 때, 어떻게 나누어야 하는지 구하는 프로그램을 작성하시오. 단, 앞자리에 0이 오는 것을 허용한다.

입력

첫째 줄에 문자열이 주어진다. 이 문자열의 자릿수는 80자리를 넘지 않는다.

출력

수열의 마지막 숫자를 출력하시오. 앞자리에 0이 있는 경우에는 0을 생략하고 출력한다.

예제 입력 1

3456

예제 출력 1

6

예제 입력 2

0001

예제 출력 2

1

예제 입력 3

100000101

예제 출력 3

101
W3sicHJvYmxlbV9pZCI6IjIwMzUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM5OWRcdWFjMDBcdWMyMThcdWM1ZjQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzIyYlx1Yzc5MFx1Yjg1YyBcdWM3NzRcdWI4ZThcdWM1YjRcdWM5YzQgXHViYjM4XHVjNzkwXHVjNWY0XHVjNzc0IFx1Yzc4OFx1YjJlNC4gXHVjNzc0IFx1YzIyYlx1Yzc5MFx1Yjk3YyBcdWM4MDFcdWM4MDhcdWQ3ODggXHViMDk4XHViMjA0XHVjNWI0XHVjMTFjIFx1Yzk5ZFx1YWMwMFx1YzIxOFx1YzVmNFx1Yzc0NCBcdWI5Y2NcdWI0ZTRcdWFjZTBcdWM3OTAgXHVkNTVjXHViMmU0LiBcdWM2MDhcdWI5N2MgXHViNGU0XHVjNWI0IDM1NDZcdWM3NDQgXHViMDk4XHViMjA4XHViMmU0XHViYTc0IDMsNSw0NiBcdWI2MTBcdWIyOTQgMzUsNDZcdWM3M2NcdWI4NWMgXHViMDk4XHViMjBjIFx1YzIxOCBcdWM3ODhcdWIyZTQuIFx1Yzc3NCBcdWM5OWRcdWFjMDBcdWMyMThcd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9uZSB3aGljaCBoYXMgdGhlIGxhcmdlc3QgXHVmYjAxcnN0IHZhbHVlOyBpZiB0aGVyZSZyc3F1bztzIGEgdGllLCB0aGUgbGFyZ2VzdCBzZWNvbmQgbnVtYmVyLCBldGMuPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsImh0bWxfdGl0bGUiOiIwIiwicHJvYmxlbV9sYW5nX3Rjb2RlIjoiRW5nbGlzaCJ9XQ==

출처

ICPC > Regionals > North America > East Central North America Regional > 2002 East Central Regional Contest C번

  • 잘못된 데이터를 찾은 사람: sait2000