Dubs
SRM 692 · 2016-06-04 · by Xellos0
Problem Statement
A positive integer X is called a double number if its decimal representation (without leading zeroes) has the following properties:
- it contains at least two digits
- the two least significant digits are identical
For example, 1488 is a double number, but 3 and 221 are not.
You are given two
Constraints
- L will be between 10 and 1,000,000,000,000 (10^12), inclusive.
- R will be between L and 1,000,000,000,000 (10^12), inclusive.
113464799236 699002764401 Returns: 58553796517
random
501346554765 950073613017 Returns: 44872705826
random
48376858957 220792504052 Returns: 17241564509
random
101337192990 378858372907 Returns: 27752117992
random
38545321940 106671028225 Returns: 6812570629
random
124611151838 239397661677 Returns: 11478650984
random
138547834386 232307426991 Returns: 9375959261
random
47125899421 191084480726 Returns: 14395858131
random
82895970282 175876717732 Returns: 9298074745
random
923003927863 998207498364 Returns: 7520357050
random
10 10 Returns: 0
The only number in the range [10,10] is 10. It isn't a double number.
10 20 Returns: 1
The only double number in the range [10,20] is 11.
49 101 Returns: 6
The double numbers are 55, 66, 77, 88, 99 and 100.
47 53 Returns: 0
zero
826611854162 826611854164 Returns: 0
zero
888888888883 888888888883 Returns: 0
zero
688390061801 688390061810 Returns: 0
zero
Submissions are judged against all 56 archived test cases, of which 17 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class Dubs with a public method long long count(long long L, long long R) · 56 test cases · 2 s / 256 MB per case