시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 710 567 517 82.853%

문제

이 문제에서 당신은 Quicksum이라고 하는 checksum 알고리즘을 구현해야 한다.  Quicksum 패킷은 오직 대문자와 공백으로 이루어져있다. 그리고 시작과 끝은 항상 대문자이다.  공백은 문자와 섞여있을수 있으며 연속되어서 있을수도 있다.

Quicksum은 각각의 문자의 위치와 문자 값의 합이다. 공백은 0이다. 문자는 고유의 위치값을 가지고 있는데 예를들어 A=1, B=2 ... Z=26이다.

예제 문장은 "ACM" 과 "MID CENTRAL"인데 살펴보면 다음과 같다.

ACM: 1*1  + 2*3 + 3*13 = 46

MID CENTRAL: 1*13 + 2*9 + 3*4 + 4*0 + 5*3 + 6*5 + 7*14 + 8*20 + 9*18 + 10*1 + 11*12 = 650

입력

# 이 들어오기 전까지 계속 입력을 받는다. 각각의 패킷은 한줄에 하나씩 입력이 되며 공백으로 시작되거나 끝나지 않으며, 대문자만 입력이 된다. 패킷의 길이는 1~255자이다.

출력

각각의 패킷에 따라 한줄에 하나씩 Quicksum 을 출력하라.

예제 입력 1

ACM
MID CENTRAL
REGIONAL PROGRAMMING CONTEST
ACN
A C M
ABC
BBC
#

예제 출력 1

46
650
4690
49
75
14
15
W3sicHJvYmxlbV9pZCI6IjQ2MTMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJRdWlja3N1bSIsImRlc2NyaXB0aW9uIjoiPHA+XHVjNzc0IFx1YmIzOFx1YzgxY1x1YzVkMFx1YzExYyBcdWIyZjlcdWMyZTBcdWM3NDAgUXVpY2tzdW1cdWM3NzRcdWI3N2NcdWFjZTAgXHVkNTU4XHViMjk0IGNoZWNrc3VtIFx1YzU0Y1x1YWNlMFx1YjlhY1x1Yzk5OFx1Yzc0NCBcdWFkNmNcdWQ2MDRcdWQ1NzRcdWM1N2MgXHVkNTVjXHViMmU0LiAmbmJzcDtRdWlja3N1bSBcdWQzMjhcdWQwYjdcdWM3NDAgXHVjNjI0XHV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BsaW5lIGJ5IGl0c2VsZiwgZG9lcyBub3QgYmVnaW4gb3IgZW5kIHdpdGggYSBzcGFjZSwgYW5kIGNvbnRhaW5zIGZyb20gMSB0byAyNTUgY2hhcmFjdGVycy48XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5Gb3IgZWFjaCBwYWNrZXQsIG91dHB1dCBpdHMgUXVpY2tzdW0gb24gYSBzZXBhcmF0ZSBsaW5lIGluIHRoZSBvdXRwdXQuPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsImh0bWxfdGl0bGUiOiIwIiwicHJvYmxlbV9sYW5nX3Rjb2RlIjoiRW5nbGlzaCJ9XQ==

출처

ICPC > Regionals > North America > Mid-Central Regional > 2006 Mid-Central Regional Programming Contest A번

  • 문제의 오타를 찾은 사람: sky1357
  • 문제를 번역한 사람: temp
  • 빠진 조건을 찾은 사람: uk7880