| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 33 | 27 | 23 | 79.310% |
The $k^{\text{th}}$ Champernowne word is obtained by writing down the first $k$ positive integers and concatenating them together. For example, the 10ドル^{\text{th}}$ Champernowne word is 12345678910ドル$.
It can be proven that, for any finite string of digits, there exists some integer $k$ such that the finite string of digits will appear as a subsequence in the $k^{\text{th}}$ Champernowne word.
String $s$ is a subsequence of string $t$ if it is possible to delete some (possibly zero) characters from $t$ to get $s$.
Given a string of digits, compute the smallest integer $k$ such that the given string of digits is a subsequence of the $k^{\text{th}}$ Champernowne word.
The first line of input contains a single integer $n$ $(1 \leq n \leq 10^5),ドル the length of the string of digits.
The second line of input contains a string of $n$ digits.
Output a single integer $k,ドル the minimum integer such that the given string is a subsequence of the $k^{\text{th}}$ Champernowne word.
2 90
10
2 00
20
ICPC > Regionals > North America > Pacific Northwest Regional > 2024 ICPC Pacific Northwest Regional > Division 1 C번
ICPC > Regionals > North America > Pacific Northwest Regional > 2024 ICPC Pacific Northwest Regional > Division 2 H번