본문 바로가기
python-algorithm

[백준] 8958

by 무적김두칠 2021. 1. 10.

1
2
3
4
5
6
7
for _ in range(int(input())):
    ans=0
    cnt=0
    for i in input():
        if i=='O' :cnt+=1; ans+=cnt
        else: cnt=0
    print(ans)
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 9070  (0) 2021.01.10
[백준] 9046  (0) 2021.01.10
[백준] 7600  (0) 2021.01.10
[백준] 7572  (0) 2021.01.10
[백준] 7567  (0) 2021.01.10

댓글