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

28375번 - German Conference for Public Counting 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB104786581.250%

문제

Greta loves counting. She practises it every day of the year. Depending on the season, she counts falling leaves, raindrops, snowflakes, or even growing leaves. However, there is one event in summer which tops everything else: the German Conference for Public Counting (GCPC).

At this event, Greta meets counting enthusiasts from all over the country for one week of counting and counting and counting... Together they participate in the Glamorous Competitive Public Counting and the Great Chaotic Public Counting. At the end of the week they all try to win the Golden Cup of Public Counting. Her favourite is the Gently Calming Public Counting where the crowd counts in silence, trying to harmoniously synchronise to reach the target number at precisely the same moment.

Figure G.1: People holding up signs for the countdown.

To increase the tension and to prepare for the Gently Calming Public Counting, the organizers of GCPC plan to start with a silent countdown, where the people on the stage will at any time display the current number by holding up signs with its digits. On every sign, there is exactly one decimal digit. Numbers greater than 9ドル$ are displayed by holding up several signs next to each other. Each number is shown using the least possible number of signs; there is no left padding with zeroes. This way, the people on the stage display numbers $n, n-1, n-2, \dots$ until they finally display 0ドル$. Since the GCPC will take place soon, the organizers want to finish their preparations quickly. How many signs do they need to prepare at least so that they can display the entire countdown from $n$ to 0ドル$?

입력

The input consists of:

  • One line with an integer $n$ (1ドル \le n \le 10^9$), the starting number of the countdown.

출력

Output the minimum number of signs required to display every number of the countdown.

제한

예제 입력 1

5

예제 출력 1

6

예제 입력 2

20

예제 출력 2

11

예제 입력 3

44

예제 출력 3

14

예제 입력 4

271828182

예제 출력 4

82

예제 입력 5

314159265

예제 출력 5

82

힌트

In the first sample case, the organizers need one sign each with the digits 0ドル$ to 5ドル,ドル for a total of 6ドル$ signs. In the second sample case, they need one sign with each digit other than 1ドル,ドル and two signs with a 1ドル,ドル for a total of 9ドル+2=11$ signs.

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > German Collegiate Programming Contest > GCPC 2023 G번

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

출처

대학교 대회

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

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