# P3107 [USACO14OPEN]里程表Odometer

• 49通过
• 143提交
• 题目提供者 FarmerJohn2
• 评测方式 云端评测
• 标签 Splay 动态规划,动规,dp USACO 2014 高性能
• 难度 省选/NOI-
• 时空限制 1000ms / 128MB
• 提示：收藏到任务计划后，可在首页查看。

## 题目描述

Farmer John's cows are on a road trip! The odometer on their car displays an integer mileage value, starting at X (100 <= X <= 10^18) miles at the beginning of their trip and ending at Y (X <= Y <= 10^18) miles at the end of their trip. Whenever the odometer displays an 'interesting' number (including at the start and end of the trip) the cows will moo. A number is 'interesting' if when you look at all its digits except for leading zeros, at least half of these should be the same. For example, the numbers 3223 and 110 are interesting, while the numbers 97791 and 123 are not.

Help FJ count how many times the cows will moo during the trip.

农民约翰的牛正开始一个美妙的旅程。牛车的里程表上显示一个整数表示里程，旅程开始时里程数为X(100 <= X <= 10^18)，结束时里程数为Y(X <= Y <= 10^18)。每当里程表显示一个有趣的数时（包括起点和终点数），牛们会发出愉快的叫声。

对于一个里程数的每一位，如果有至少一半的数字时相同的，则这个里程数一个有趣的数。例如：3223和110是有趣的数，而97791 和 123则不是。

请计算，整个旅程中，牛们会发出多少吃愉快的叫声。

## 输入输出格式

输入格式：

* Line 1: The first line will contain two integers, X and Y, separated by a space.

输出格式：

* Line 1: A single integer containing how many times the cows will moo during the trip.

## 输入输出样例

输入样例#1： 复制
110 133

输出样例#1： 复制
14


## 说明

The trip starts with the odometer at 110 and ends at 133.

The cows moo when the odometer reads 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, and 133.

提示
标程仅供做题后或实在无思路时参考。
请自觉、自律地使用该功能并请对自己的学习负责。
如果发现恶意抄袭标程，将按照I类违反进行处理。