-
[python]백준 점수계산 2506번알고리즘 문제풀이/백준(파이썬) 2023. 5. 16. 23:52
코드
import sys sys.stdin = open("2506.txt", "r") t=int(input()) a,b=0,0 s=list(map(int,input().split())) for j in range(t): if s[j]==1: a+=1 b+=a else: a=0 print(b)
링크
https://www.acmicpc.net/problem/2506
'알고리즘 문제풀이 > 백준(파이썬)' 카테고리의 다른 글
[python]백준 욱제는 효도쟁이야!! 14487번 (0) 2023.05.18 [python]백준 심부름 가는 길 5554번 (0) 2023.05.17 [python]백준 2017 연세대학교 프로그래밍 경시대회 14568번 (0) 2023.05.15 [python]백준 연속구간 2495번 (0) 2023.05.14 [python]백준 0123456789 6916번 (1) 2023.05.13