五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

B - ABCDEFG

2023-06-19 11:06 作者:您是打尖兒還是住店呢  | 我要投稿

Problem Statement

There are7 pointsA,B,C,D,E,F, andG on a straight line, in this order. (See also the figure below.)

The distances between adjacent points are as follows.

Between

A andB:3

BetweenB andC:1

BetweenC andD:4

BetweenD andE:1

BetweenE andF:5

BetweenF andG:9

You are given two uppercase English letters

p andq. Each ofp andq is A, B, C, D, E, F, or G, and it holds that p<>q.

Find the distance between the points

p andq.

Constraints

Each of? p andq is A,B,C,D,E,F, or G.p<>=q

Input

The input is given from Standard Input in the following format:

p q

Output

Print the distance between the points p and q.


Sample Input 1

A C

Sample Output 1

4

The distance between the points

A andC is

3+1=4.

Sample Input 2

G B

Sample Output 2

20

The distance between the pointsG andB is

9+5+1+4+1=20.

Sample Input 3

C F

Sample Output 3

10

把所有數(shù)據(jù)放到數(shù)組中,然后根據(jù)輸入的數(shù)據(jù)相減即可得出,也就是用prefix_sum(前綴和)計(jì)算;

下面是代碼:


B - ABCDEFG的評(píng)論 (共 條)

分享到微博請遵守國家法律
枝江市| 蒲城县| 建水县| 浮梁县| 凌源市| 房产| 珲春市| 湖南省| 琼中| 临猗县| 金山区| 蒙自县| 舟曲县| 鸡东县| 洪雅县| 资阳市| 金阳县| 天全县| 江北区| 嘉鱼县| 潼南县| 邢台市| 老河口市| 抚州市| 榕江县| 荔浦县| 平武县| 德格县| 年辖:市辖区| 肥西县| 通城县| 盐城市| 上杭县| 稷山县| 青神县| 原阳县| 遵义县| 泗洪县| 施甸县| 克东县| 许昌市|