[Bronze II] Title: Word Mix, Time: 32 ms, Memory: 32412 KB -BaekjoonHub
This commit is contained in:
28
백준/Bronze/26590. Word Mix/README.md
Normal file
28
백준/Bronze/26590. Word Mix/README.md
Normal 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>
|
||||
|
||||
14
백준/Bronze/26590. Word Mix/Word Mix.py
Normal file
14
백준/Bronze/26590. Word Mix/Word Mix.py
Normal 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))
|
||||
Reference in New Issue
Block a user