일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- string to list
- Chat-GPT
- 플라스크
- colab runtime
- 웹페이지
- convert to shp
- 혁신성장부문
- 파이썬
- python buildpacks
- clustering
- 괄호 문제
- kmeans
- 2164 카드2
- 알고리즘
- 해시태그
- Selenium
- Crawling
- Merge Repositories
- to shp
- flask
- 크롤링
- 셀레니움
- geopandas
- 백준
- 인스타그램
- Python
- geoDataFrame
- plotly dash
- 코랩 런타임
- NLP
Archives
- Today
- Total
코딩코딩코딩
백준(BAEKJOON) 11399 ATM - 파이썬(python) 본문
제출 코드:
N = int(input())
each_time = list(map(int, input().split()))
sorted_time = sorted(each_time)
temp = [sorted_time[0]] # 정렬된 시간 리스트의 첫 번째 원소를 넣어둔 리스트 생성
# 누적합을 구하기 위해 정렬된 시간 리스트의 마지막 원소 전까지 for문 수행
for i in range(len(sorted_time)-1):
temp.append(temp[i] + sorted_time[i+1]) # 누적합 계산하여 temp에 추가
print(sum(temp))
'파이썬 > Algorithms' 카테고리의 다른 글
백준(BAEKJOON) 2571 수 정렬하기 2 - 파이썬(python) (0) | 2021.10.20 |
---|---|
프로그래머스(Programmers) Demo Test 나머지 한 점 - 파이썬(python) (0) | 2021.10.06 |
백준(BAEKJOON) 11034 캥거루 세마리2 - 파이썬(python) (0) | 2021.09.13 |
백준(BAEKJOON) 2720 세탁소 거스름돈 - 파이썬(python) (0) | 2021.09.09 |
백준(BAEKJOON) 10162 전자레인지 - 파이썬(python) (0) | 2021.09.08 |
Comments