## 10712 - Count the Numbers

**Moderator:** Board moderators

### 10712 - Count the Numbers

I got WA all the time.

Could someone give me sone input/output ?

Thx

Could someone give me sone input/output ?

Thx

- Martin Macko
- A great helper
**Posts:**481**Joined:**Sun Jun 19, 2005 1:18 am**Location:**European Union (Slovak Republic)

Please, could somebody give me some tricky test cases? I am getting WA and don't know why...

I have chcecked lots of my answers for short intervals by
but have not found any problematic case.

In my solution I decompose the interval [A, B] info intervals of the form [a*10^k, (a+1)*10^k-1] and process each of them independently. For every such interval I chceck by the inclusion-exlusion principle all possible positions of N as a subsequence of a number from the interval. Is there anything wrong in my logic?

thanks

I have chcecked lots of my answers for short intervals by

Code: Select all

`seq $A $B | grep $N | wc -l`

In my solution I decompose the interval [A, B] info intervals of the form [a*10^k, (a+1)*10^k-1] and process each of them independently. For every such interval I chceck by the inclusion-exlusion principle all possible positions of N as a subsequence of a number from the interval. Is there anything wrong in my logic?

thanks

- Martin Macko
- A great helper
**Posts:**481**Joined:**Sun Jun 19, 2005 1:18 am**Location:**European Union (Slovak Republic)

- Martin Macko
- A great helper
**Posts:**481**Joined:**Sun Jun 19, 2005 1:18 am**Location:**European Union (Slovak Republic)