반응형
Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- GET REQUESTS
- neo4j
- 그랜빌의 법칙
- 파이썬
- pandas-profiling
- 투포인터
- Sequenial
- 백준 7795
- nodemon babel
- PREFECT
- 첫서버
- neo4j 인덱스 사용
- gensim size
- gensim_models
- 플로이드워셜
- gensim
- spring-boot3
- cs50
- BFS
- 백준
- 백준 2470
- 텍스트전처리
- 워드 임베딩
- neo4j 제약조건
- UnsatisfiedDependencyException
- express
- spring-boot2
- 백준 회전초밥
- 알고리즘
- neo4j 스키마 정의
Archives
- Today
- Total
정리정돈
[백준 11728] 배열 합치기(Python) 본문
728x90
반응형
https://www.acmicpc.net/problem/11728
11728번: 배열 합치기
첫째 줄에 배열 A의 크기 N, 배열 B의 크기 M이 주어진다. (1 ≤ N, M ≤ 1,000,000) 둘째 줄에는 배열 A의 내용이, 셋째 줄에는 배열 B의 내용이 주어진다. 배열에 들어있는 수는 절댓값이 109보다 작거
www.acmicpc.net
n, m = map(int, input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
answer = []
a_start = 0
b_start = 0
while a_start < n or b_start<m:
if b_start >= m or (a_start < n and a[a_start] <= b[b_start]):
answer.append(a[a_start])
a_start += 1
else:
answer.append(b[b_start])
b_start += 1
print(' '.join(list(map(str,answer))))
알고리즘 분류
- 정렬
- 투 포인터
728x90
반응형
'알고리즘 > 백준' 카테고리의 다른 글
[백준 2531] 회전 초밥 (Python) (0) | 2022.03.25 |
---|---|
[백준 2470] 두 용액 (Python) (0) | 2022.03.24 |
[백준 1644] 소수의 연속합(Python) (0) | 2022.03.24 |
[백준 1697] 숨바꼭질(Python) (0) | 2021.06.09 |
[백준 8958번] OX퀴즈(Python) (0) | 2021.06.06 |