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
- Continuous Deployment
- EC2
- QuerySet
- testcase
- DRF
- racecondition
- Prefetch_related
- Python
- django
- CD
- 코루틴
- DjangoRestFramework
- annotate
- F객체
- docker
- CI
- to_attr
- dry-yasg
- Transaction
- DjangoCache
- aggregate
- database
- nestedfunction
- aws
- Coroutine
- Continuous Delivery
- Git
- apitestcase
- 백준
- 도커
Archives
- Today
- Total
BackEnd King KY
백준 1026 본문
728x90
✔️문제
https://www.acmicpc.net/problem/1026
1026번: 보물
첫째 줄에 N이 주어진다. 둘째 줄에는 A에 있는 N개의 수가 순서대로 주어지고, 셋째 줄에는 B에 있는 수가 순서대로 주어진다. N은 50보다 작거나 같은 자연수이고, A와 B의 각 원소는 100보다 작거
www.acmicpc.net
✔️풀이
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = 0
while n>0:
s += min(a)*max(b)
a.pop(a.index(min(a)))
b.pop(b.index(max(b)))
n-=1
print(s)
a배열의 최소값과 b배열의 최대값을 곱해서 더해야 하는 문제입니다.
그 다음 pop()을 이용해 사용한 최소값과 최대값을 제거합니다.