[백준] 2506번 : 점수계산 - Python(파이썬)

강재원·2022년 10월 2일
0

[코딩테스트] Python

목록 보기
87/200



https://www.acmicpc.net/problem/2506

n=int(input())
sum=0
count=0
k=list(map(int,input().split()))
for i in range(n):
    a=k[i]
    if a==1:
        count+=1
        sum+=count
    else: count=0
print(sum)
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글