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

문제 문제 링크 코드 import sys input = sys.stdin.readline n = int(input()) t = list(map(int, input().split())) t.sort() result = -1 if n % 2 == 0: for i in range(int(n / 2)): result = max(result, t[i] + t[len(t)-i-1]) else: result = max(result, t.pop()) for i in range(int(n / 2)): result = max(result, t[i] + t[len(t)-i-1]) print(result)
알고리즘 문제/그리디 문제
2022. 7. 20. 13:35