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 |
Tags
- F객체
- django
- testcase
- Git
- docker
- Continuous Delivery
- racecondition
- dry-yasg
- to_attr
- aws
- DRF
- DjangoCache
- Transaction
- Continuous Deployment
- Python
- 도커
- EC2
- database
- annotate
- CD
- CI
- 백준
- Coroutine
- Prefetch_related
- QuerySet
- 코루틴
- aggregate
- apitestcase
- DjangoRestFramework
- nestedfunction
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()을 이용해 사용한 최소값과 최대값을 제거합니다.