최대 1 분 소요

사용 언어: Python3

문제

성적 평균

풀이

내 풀이

import sys

def process():
    s, e = map(int, input().split())
    s, e = s-1, e-1
    section = lst[s:e+1]
    print('%0.2f' % (sum(section) / len(section))) # ✅ 서식 지정자

N, K = map(int, input().split())
lst = list(map(int, input().split()))

for _ in range(K):
    process()


💛 개인 공부 기록용 블로그입니다. 👻

맨 위로 이동하기