일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- popleft
- 그리디 알고리즘
- appendleft
- pypy3
- deque
- Java
- Python
- LCM
- 누적합
- BFS
- c#
- 연관관계
- mvc
- python3
- unity
- 소수찾기
- C#강의
- 브루투포스
- 파이썬
- 소수판별
- 우선순위큐
- spring
- JPA
- 인프런
- 백준
- 합 구하기
- 1일1솔
- DP
- 프로그래머스
- 완전탐색
Archives
- Today
- Total
목록11441 (1)
jae_coding

문제 문제 링크 문제 접근 누적합 input 리스트 생성 0번째 인덱스부터 차례대로 n-1번째까지 누적합 구하기 a ~ b이면 누적합 b - 누적합 a를 구해준다 (시작점이 1인점은 제외) 코드 import sys input = sys.stdin.readline n = int(input()) # 입력 리스트 a = list(map(int, input().split())) # 누적합 구하기 s = list() s.append(a[0]) for i in range(1, n): s.append(s[i-1] + a[i]) m = int(input()) for i in range(m): start, end = map(int, input().split()) if start == 1: print(s[end-1]) e..
알고리즘 문제/백준
2022. 7. 27. 12:26