Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
|---|---|---|---|---|---|---|
| 1570 | Kotlin Heroes: Practice 8 | FINISHED | False | 518400 | 143310323 | Oct. 1, 2021, 1:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 273 ) | D | Reachable Numbers | PROGRAMMING | *special implementation |
Let's denote a function (f(x)) in such a way: we add (1) to (x), then, while there is at least one trailing zero in the resulting number, we remove that zero. For example, (f(599) = 6): (599 + 1 = 600 \rightarrow 60 \rightarrow 6); (f(7) = 8): (7 + 1 = 8); (f(9) = 1): (9 + 1 = 10 \rightarrow 1); (f(10099) = 101): (10099 + 1 = 10100 \rightarrow 1010 \rightarrow 101). We say that some number (y) is reachable from (x) if we can apply function (f) to (x) some (possibly zero) times so that we get (y) as a result. For example, (102) is reachable from (10098) because (f(f(f(10098))) = f(f(10099)) = f(101) = 102); and any number is reachable from itself. You are given a number (n); your task is to count how many different numbers are reachable from (n). The first line contains one integer (n) ((1 \le n \le 10^9)). Print one integer: the number of different numbers that are reachable from (n). The numbers that are reachable from (1098) are: (1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1098, 1099). |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 131006778 | Walingar | D | Oct. 6, 2021, 6:34 p.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130964727 | Pipall | D | Oct. 6, 2021, 10:03 a.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130937502 | mister_bull | D | Oct. 6, 2021, 3:09 a.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130755881 | fuadul | D | Oct. 4, 2021, 4:16 a.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130633422 | dqhungdl | D | Oct. 3, 2021, 8:29 a.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130607772 | TruFire | D | Oct. 3, 2021, 1:55 a.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130576105 | Alexander_Runov | D | Oct. 2, 2021, 3:11 p.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130547934 | hritik31 | D | Oct. 2, 2021, 9:49 a.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130546408 | ThinkTwice | D | Oct. 2, 2021, 9:31 a.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130508010 | 30something | D | Oct. 1, 2021, 9:50 p.m. | OK | Kotlin 1.4 | TESTS | 130 | 109 | 20889600 | ||
| 130766404 | ankushkhanna | D | Oct. 4, 2021, 6:45 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 171 | 25395200 | ||
| 131038417 | ananiya | D | Oct. 7, 2021, 7:04 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 186 | 25292800 | ||
| 130964672 | Bingoblin | D | Oct. 6, 2021, 10:02 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 186 | 25292800 | ||
| 131053465 | noisegain | D | Oct. 7, 2021, 10:12 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 187 | 25292800 | ||
| 131048032 | TusharBhut | D | Oct. 7, 2021, 9:03 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 187 | 25292800 | ||
| 131044048 | JaxYoung | D | Oct. 7, 2021, 8:17 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 187 | 25292800 | ||
| 131043787 | JaxYoung | D | Oct. 7, 2021, 8:14 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 187 | 25292800 | ||
| 131025059 | at1 | D | Oct. 7, 2021, 3:18 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 187 | 25292800 | ||
| 131024362 | smax | D | Oct. 7, 2021, 3:02 a.m. | OK | Kotlin 1.5 | TESTS | 130 | 187 | 25292800 | ||
| 130974657 | mip182 | D | Oct. 6, 2021, 12:10 p.m. | OK | Kotlin 1.5 | TESTS | 130 | 187 | 25292800 |
Back to search problems