점수 계산

이세진·2022년 4월 15일
0

코테준비

목록 보기
10/87

생성일: 2022년 1월 8일 오후 9:49

구현 코드

# 점수 계산
import sys
sys.stdin = open("input.txt", "rt")
n = int(input())
oneList = []
result = 0
oxList = list(map(int, input().split()))

for x in oxList:
    if x == 0:
        oneList.clear()
    else:
        oneList.append(1)
        result += len(oneList)

print(result)
profile
나중은 결코 오지 않는다.

0개의 댓글