[Bronze II] Title: Word Mix, Time: 32 ms, Memory: 32412 KB -BaekjoonHub

This commit is contained in:
SSUM
2025-03-24 20:51:25 +09:00
parent bab8f2a984
commit eb28f3e018
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# [Bronze II] Word Mix - 26590
[문제 링크](https://www.acmicpc.net/problem/26590)
### 성능 요약
메모리: 32412 KB, 시간: 32 ms
### 분류
구현, 문자열
### 제출 일자
2025년 3월 24일 20:51:18
### 문제 설명
<p>Write a program that will combine two words into a new one. The length of the two words will be unknown. The new word will be the same length as the shorter word. The letters at even indexes will be taken from the first word at the corresponding indexes and the letters at odd indexes will be taken from the second word at the corresponding indexes.</p>
### 입력
<p>The input will contain two words on a single line, separated by a single space.</p>
### 출력
<p>Display the mixed word.</p>

View File

@@ -0,0 +1,14 @@
import sys
word1, word2 = sys.stdin.readline().strip().split()
min_len = min(len(word1), len(word2))
result = []
for i in range(min_len):
if i % 2 == 0:
result.append(word1[i])
else:
result.append(word2[i])
print(''.join(result))