반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 지도자동구축 파이썬
- MySQL완전삭제
- 백준
- 도커 컨테이너
- 장애물인식프로그램 파이썬
- 피아노체조 파이썬
- 파이썬 평범한배낭
- express
- 1987파이썬
- express mongodb
- 파이썬데이터분석라이브러리
- 백준 A->B
- 등수매기기 파이썬
- 백준 피아노체조
- 소프티어 장애물인식프로그램
- CRUD
- 백준 등수매기기
- 백준 전쟁-전투
- 백준 예산
- 백준알파벳파이썬
- 백준 점프
- 금고털이 파이썬
- 백준 전쟁 파이썬
- jenkins
- MongoDB
- 프로그래머스
- 백준 평범한배낭
- 백준 바이러스
- 소프티어 지도자동구축
- 백준 점프 파이썬
Archives
- Today
- Total
바위 뚫는중
[소프티어] Lv3. 성적평균 본문
반응형
3️⃣ 성적평균
https://softeer.ai/practice/6294
💡 아이디어
누적하고 나누어서 풀었다
📝 풀이
('{:.2f}'.format(round(ans,2)))
정수인것을 실수로 소수 둘째 자리 까지 나타내기! 외워야겠다 format외우자
import sys
import math
input = sys.stdin.readline
n , k = map(int, input().split())
student = list(map(int, input().split()))
for _ in range(k):
a, b = map(int, input().split())
sum = 0
for i in range(a-1,b):
sum += student[i]
ans = sum/(b-a+1)
print('{:.2f}'.format(round(ans,2)))
반응형
'Algorithms > 소프티어' 카테고리의 다른 글
[소프티어] Lv2. 지도 자동 구축 (0) | 2023.11.21 |
---|---|
[소프티어] Lv2. 금고털이 (0) | 2023.11.21 |
[소프티어] Lv2. GBC (0) | 2023.11.21 |
[소프티어] Lv2. 전광판 (0) | 2023.11.06 |
[소프티어] Lv2. 바이러스 (0) | 2023.11.03 |