## 문제
BOJ 8958
## solution
ooxxoxxooo의 경우 문제의 점수는 연속된 o의 개수가 된다. 1+2+0+0+1+0+0+1+2+3 = 10점이 되는 것.
점수 count를 총점에 따로 더하고 count는 틀릴경우 초기화 하면 될듯 싶다.
## CODE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmp_case = int(input()) | |
score_result = [] | |
for k in range(tmp_case): | |
line_input = input() | |
line_score = 0 | |
score_count = 1 | |
for tmp in line_input: | |
if tmp == 'O': | |
line_score += score_count | |
score_count += 1 | |
else: | |
score_count = 1 | |
score_result += [line_score] | |
for k in score_result: | |
print(k) |
0 댓글