Canadian Computing Competition: 2017 Stage 1, Junior #4
Wendy has an LED clock radio, which is a 12-hour clock, displaying times from
When looking at her LED clock radio, Wendy likes to spot arithmetic sequences in the digits. For example, the times
A sequence of digits is an arithmetic sequence if each digit after the first digit is obtained by adding a constant common difference. For example,
Suppose that we start looking at the clock at noon (that is, when it reads
Input Specification
The input contains one integer
For 4 of the 15 available marks,
Output Specification
Output the number of times that the clock displays a time where the digits form an arithmetic sequence starting from noon (
Sample Input 1
34
Sample Output 1
1
Explanation for Sample Output 1
Between
Sample Input 2
180
Sample Output 2
11
Explanation for Sample Output 2
Between
(difference 1), (difference 0), (difference 1), (difference 2), (difference 3), (difference 4), (difference -1), (difference 0), (difference 1), (difference 2), (difference 3).
Comments
I wasted so long because I thought the digits could go like 1, 0, 9 with the difference being -1. Dont be a silly billy like me
you know who is a sillybilly???
be careful if the imput is larger than 720, lol.
How can I fix the TLE problem?
How many such arithmetic sequences appear in the 12-hour (720-minute) cycle?
If the input exceeds 720, do we really need to compute all the arithmetic sequences? Won't that take too long?
This is why you TLE.
can anybody check my latest submission
Test cases like
900
,3600
and6969
failWhat would be the answer, mine is 42, 156 and 309 and DMOJ says mine is wrong┭┮﹏┭┮
D:
What a shame "6:66" isn't a thing.
Wow! 2017 was filled with Math questions! Interesting.
I keep getting tle at start of batch#3 help
D has a max value of 1 billion. Looping through all values is too slow
The perfect way to describe this question: observing a clock for up to 1901 years. Hmmm... Not bad ill just see how many times my favourite number comes on! Oh btw my favourite number are only patterns how sad
lol, imagine doing that
No j5?
J5 is the same question as S3 https://dmoj.ca/problem/ccc17s3