AtCoder Beginner Contest 148 - Strings with the Same Length

Given are strings s and t of length N each, both consisting of lowercase English letters.
Let us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.

-----Constraints-----
 - 1 \leq N \leq 100
 - |S| = |T| = N
 - S and T are strings consisting of lowercase English letters.

-----Input-----
Input is given from Standard Input in the following format:
N
S T

-----Output-----
Print the string formed.

-----Sample Input-----
2
ip cc

-----Sample Output-----
icpc

Difficulty: EASY

Starter code:

Solutions:
N = int(input())
(S, T) = map(str, input().split())
for i in range(N):
	print(S[i] + T[i], end='')


N = int(input())
S = input().split()
for i in range(N):
	print(S[0][i] + S[1][i], end='')


n = int(input())
(s, t) = input().split()
print(*[i + j for (i, j) in zip(s, t)], sep='')


import sys
import itertools

def resolve(in_):
	N = int(next(in_))
	(S, T) = next(in_).strip().split()
	ans = itertools.chain.from_iterable(list(zip(S, T)))
	return ''.join(ans)

def main():
	answer = resolve(sys.stdin)
	print(answer)

def __starting_point():
	main()
__starting_point()


def main():
	n = int(input())
	(s, t) = input().split()
	print(*[s[i] + t[i] for i in range(n)], sep='')

def __starting_point():
	main()
__starting_point()


N = int(input())
a = input().split()
(S, T) = (a[0], a[1])
d = ''
for i in range(N):
	d = d + S[i] + T[i]
print(d)


n = int(input())
(S, T) = input().split()
for (s, t) in zip(S, T):
	print(s + t, end='')


input()
(s, t) = input().split()
print(''.join([a + b for (a, b) in zip(s, t)]))


n = int(input())
(s, t) = input().split()
lists = []
for i in range(n):
	lists.append(s[i])
	lists.append(t[i])
print(''.join(lists))


N = input()
(s1, s2) = input().split()
for i in range(int(N)):
	print(s1[i] + s2[i], end='')


N = int(input())
(s, t) = input().split()
u = ''
for i in range(0, N):
	u = u + s[i] + t[i]
print(u)


N = input()
(S, T) = input().split()
print(*[s + t for (s, t) in zip(S, T)], sep='')


n = int(input())
(s, t) = list(input().split())
ans = ''
for i in range(n):
	ans += s[i] + t[i]
print(ans)


n = int(input())
(s, t) = input().split()
print(*[s + t for (s, t) in zip(s, t)], sep='')


n = int(input())
(s, t) = map(str, input().split())
a = ''
for i in range(n):
	a += s[i] + t[i]
print(a)


def main():
	n = int(input())
	(S, T) = input().split()
	print(*[s + t for (s, t) in zip(S, T)], sep='')

def __starting_point():
	main()
__starting_point()


def main():
	N = int(input())
	(S, T) = input().split()
	for i in range(N):
		print(S[i] + T[i], end='')
	print()

def __starting_point():
	main()
__starting_point()


n = int(input())
(s, t) = input().split()
l = ''
for i in range(n):
	l += s[i] + t[i]
print(l)


_ = input()
(S, T) = input().split()
ans = ''
for (s, t) in zip(S, T):
	ans += s
	ans += t
print(ans)


n = int(input())
(A, B) = input().split()
C = ''
for i in range(n):
	C += A[i]
	C += B[i]
print(C)


n = int(input())
(s, t) = input().split()
for i in range(n):
	print(s[i] + t[i], end='')


n = input()
(S, T) = input().split()
for (i, j) in zip(S, T):
	print(i, j, sep='', end='')


N = int(input())
(S, T) = list(map(str, input().split()))
i = 0
ST = ''
while i < N:
	ST = ST + S[i] + T[i]
	i += 1
print(ST)


N = int(input())
(A, B) = input().split()
S = ''
for i in range(N):
	S += A[i] + B[i]
print(S)


N = int(input())
(S, T) = list(map(str, input().split()))
new_string = []
i = 0
for i in range(N):
	string1 = list(S).pop(i)
	string2 = list(T).pop(i)
	new_string.append(string1)
	new_string.append(string2)
	i += 1
new_string = ''.join(new_string)
print(new_string)


input()
print(''.join((a + b for (a, b) in zip(*input().split()))))


N = int(input())
S = input()
print(''.join([S[i] + S[i + N + 1] for i in range(N)]))


N = int(input())
(S, T) = input().split()
s = ''.join((i + j for (i, j) in zip(S, T)))
print(s)


_ = input()
(S, T) = input().split()
print(''.join(sum([[a, b] for (a, b) in zip(S, T)], [])))


n = int(input())
(a, b) = input().split()
word = ''
for i in range(n):
	word += a[i] + b[i]
print(word)


N = int(input())
(S, T) = input().split()
for (i, j) in zip(S, T):
	print(i, j, sep='', end='')


a = int(input())
(p, q) = input().split()
ans = ''
for i in range(a):
	ans += p[i]
	ans += q[i]
print(ans)


n = input()
(S, T) = input().split()
print(*[s + t for (s, t) in zip(S, T)], sep='')


N = int(input())
(S, T) = map(str, input().split())
for (s, t) in zip(list(S), list(T)):
	print(s + t, end='')
print('')


N = int(input())
(S, T) = input().split()
print(''.join([s + t for (s, t) in zip(S, T)]))


n = int(input())
(s, t) = input().split()
c = ''
for i in range(0, n):
	c = c + s[i] + t[i]
print(c)


n = int(input())
(s, t) = input().split()
x = ''
for i in range(n):
	x += s[i]
	x += t[i]
print(x)


n = int(input())
(s, t) = input().split()
print(*[s[i] + t[i] for i in range(n)], sep='')


input()
(S, T) = input().split()
print(''.join([s + t for (s, t) in zip(S, T)]))


n = int(input())
(a, b) = input().split()
str = ''
for i in range(n):
	str += a[i] + b[i]
print(str)


input()
(S, T) = map(str, input().split())
print(*[i + j for (i, j) in zip(S, T)], sep='')


N = int(input())
(S, T) = map(str, input().split())
s_list = list(S)
t_list = list(T)
answer = []
for i in range(0, N):
	answer.append(S[i])
	answer.append(T[i])
print(''.join(answer))


n = int(input())
(s, t) = input().split()
print(*[si + ti for (si, ti) in zip(s, t)], sep='')


input()
(s1, s2) = input().split()
for (a, b) in zip(s1, s2):
	print(a + b, end='')


N = int(input())
(s, t) = input().split()
x = ''
for i in range(N):
	x = x + s[i] + t[i]
print(x)


n = int(input())
(a, b) = input().split()
s = ''
for i in range(n):
	s += a[i] + b[i]
print(s)


input()
print(''.join([s + t for (s, t) in zip(*input().split())]))


n = int(input())
(s, t) = map(str, input().split())
ans = list()
for i in range(n):
	ans.append(s[i])
	ans.append(t[i])
print(*ans, sep='')


n = int(input())
(s, t) = input().split()
li = []
for i in range(n):
	li.append(s[i] + t[i])
stra = ''.join(li)
print(stra)


N = int(input())
(S, T) = input().split()
answer = []
for i in range(0, N):
	answer.append(S[i] + T[i])
print(''.join(answer))


n = int(input())
(a, b) = input().split()
print(''.join((a[i] + b[i] for i in range(n))))


input()
print(*[i + j for (i, j) in zip(*input().split())], sep='')


n = int(input())
r = ''
(s, t) = input().split()
for i in range(n):
	r = r + s[i] + t[i]
print(r)


n = int(input())
(s1, s2) = input().split()
l = [s1[i] + s2[i] for i in range(n)]
print(''.join(l))


N = int(input())
(A, B) = input().split()
for i in range(0, N):
	print(A[i] + B[i], end='')


N = int(input())
(S, T) = input().split()
ans = ''
for i in range(0, N):
	ans = ans + S[i] + T[i]
print(ans)


N = input()
(S, T) = input().split()
msg = ''
for (s, t) in zip(S, T):
	msg += s
	msg += t
print(msg)


n = int(input())
(a, b) = input().split()
c = ''
for _ in range(n):
	c += a[_] + b[_]
print(c)


(N, S, T) = open(0).read().split()
print(''.join([''.join(s) for s in zip(S, T)]))


N = int(input())
(S, T) = input().split()
for i in range(N):
	print(S[i], T[i], sep='', end='')


N = int(input())
(s, t) = input().split()
ans = ''
for i in range(N):
	ans += s[i] + t[i]
print(ans)


n = int(input())
(s, t) = input().split()
print(''.join((c + d for (c, d) in zip(s, t))))


(_, S, T) = open(0).read().split()
print(''.join([s + t for (s, t) in zip(S, T)]))


input()
a = ''
for (x, y) in zip(*input().split()):
	a += x + y
print(a)


n = int(input())
(s, t) = input().split()
u = ''
for i in range(n):
	u = u + s[i] + t[i]
print(u)


n = int(input())
(a, b) = input().split()
c = ''
for (i, j) in zip(a, b):
	c += i + j
print(c)


N = int(input())
(S, T) = input().split()
new_string = ''
for i in range(0, N):
	ST_string = S[i] + T[i]
	new_string += ST_string
print(new_string)


N = int(input())
(S, T) = [s for s in input().split()]
ans = ''
for ss in zip(S, T):
	ans += ''.join(list(ss))
print(ans)


N = int(input())
(S, T) = input().split(' ')
print(''.join([x + y for (x, y) in zip(S, T)]))


input()
print(''.join((lambda x, y: (x[i] + y[i] for i in range(len(x))))(*input().split())))


n = int(input())
(s, t) = map(str, input().split())
for (a, b) in zip(s, t):
	print(a + b, end='')


N = int(input())
(S, T) = map(str, input().split())
U = []
for i in range(N):
	U.append(S[i])
	U.append(T[i])
print(''.join(U))


def answer(n: int, s: str, t: str) -> str:
	new_str = ''
	for i in range(n):
		new_str += f'{s[i]}{t[i]}'
	return new_str

def main():
	n = int(input())
	(s, t) = input().split()
	print(answer(n, s, t))

def __starting_point():
	main()
__starting_point()


N = int(input())
(S, T) = input().split()
print(''.join([S[i] + T[i] for i in range(N)]))


n = input()
(s, t) = map(str, input().split())
ans = ''.join((i + j for (i, j) in zip(s, t)))
print(ans)


(n, s, t) = open(0).read().split()
print(*[i + j for (i, j) in zip(s, t)], sep='')


N = int(input())
(S, T) = input().split()
A = ''
for x in range(N):
	A = A + S[x] + T[x]
print(A)


N = int(input())
(S, T) = input().split()
X = ''
for i in range(N):
	X += S[i] + T[i]
print(X)


N = int(input())
(A, B) = input().split()
t = ''
for i in range(N):
	t = t + A[i] + B[i]
print(t)


_ = input()
(S, T) = input().strip().split(' ')
print(''.join((s + t for (s, t) in zip(S, T))))


N = int(input())
(S, T) = input().split()
for x in range(N):
	print(S[x] + T[x], end='')


N = int(input())
(S, T) = input().split()
U = ''
for i in range(N):
	U += S[i] + T[i]
print(U)


n = input()
(s, t) = input().split()
pt = (p + t for (p, t) in zip(s, t))
print(''.join(pt))


n = int(input())
(a, b) = input().split()
print(''.join(map(''.join, zip(a, b))))


n = int(input())
print(''.join((a + b for (a, b) in zip(*input().split()))))


a = int(input())
(b, c) = input().split()
for i in range(a):
	print(b[i] + c[i], end='')


n = int(input())
(s, t) = map(list, input().split())
ans = []
for i in range(n):
	ans.append(s[i])
	ans.append(t[i])
print(''.join(ans))


int(input())
(a, b) = map(str, input().split())
for (x, y) in zip(a, b):
	print(x + y, end='', sep='')


n = int(input())
s = input()
s = s.split()
t = list(s[1])
s = list(s[0])
a = s[0] + t[0]
for b in range(n - 1):
	a = a + s[b + 1]
	a = a + t[b + 1]
print(a)


input()
print(''.join(sum(list(map(list, zip(*input().split()))), [])))


N = int(input())
S = input()
T = ''
for i in range(N):
	T += S[i]
	T += S[i + N + 1]
print(T)


A = int(input())
(B, C) = input().split()
D = ''
for i in range(A):
	D += B[i]
	D += C[i]
print(D)


input()
(s, t) = input().split()
print(''.join([i + j for (i, j) in zip(s, t)]))


n = int(input())
(s, t) = input().split()
a = ''.join((i + j for (i, j) in zip(s, t)))
print(a)


input()
(S, T) = input().split()
print(''.join((i + j for (i, j) in zip(S, T))))


n = int(input())
(s, t) = input().split()
a = ''
for (s, t) in zip(s, t):
	a += s + t
print(a)


n = int(input())
(s, t) = list(map(str, input().split()))
new_word_list = []
for i in range(n):
	new_word_list.append(s[i])
	new_word_list.append(t[i])
print(''.join(new_word_list))


n = int(input())
(s, t) = map(str, input().split())
ans = ['0'] * n
for i in range(n):
	ans[i] = s[i] + t[i]
print(''.join(ans))


N = input()
(S, T) = input().split()
for (s, t) in zip(S, T):
	print(s + t, end='')


N = int(input())
(S, T) = input().split()
i = 0
A = ''
while i < N:
	A += S[i] + T[i]
	i += 1
print(A)


ans = ''
n = input()
(s, t) = input().split()
for i in range(len(s)):
	ans += s[i] + t[i]
print(ans)


_ = input()
(s, t) = input().split()
a = ''
for (i, j) in zip(s, t):
	a += i + j
print(a)


n = int(input())
(s, t) = map(str, input().split())
ans = []
for i in range(len(s)):
	ans.append(s[i])
	ans.append(t[i])
ans = ''.join(ans)
print(ans)


N = int(input())
(S, T) = input().split()
a = ''
for i in range(N):
	a += S[i] + T[i]
print(a)


input()
print(*map(''.join, zip(*input().split())), sep='')


n = input()
(s, t) = input().split()
print(''.join([''.join(i) for i in zip(s, t)]))


N = int(input())
(x, y) = input().split()
for (a, b) in zip(x, y):
	print(a + b, end='')


n = input()
(s, t) = input().split()
print(*[a + b for (a, b) in zip(s, t)], sep='')


n = int(input())
(s1, s2) = input().split()
s = ''
for i in range(n):
	s += s1[i] + s2[i]
print(s)


n = input()
ans = ''
for (i, j) in zip(*input().split()):
	ans += i + j
print(ans)


N = int(input())
(S, T) = input().split()
ST = str()
for i in range(N):
	ST += S[i] + T[i]
print(ST)


input()
print(''.join(sum(zip(*input().split()), ())))


n = int(input())
(s, t) = input().split()
print(''.join([a + b for (a, b) in zip(s, t)]))


n = int(input())
(a, b) = input().split()
r = ''
for i in range(n):
	r = r + a[i]
	r = r + b[i]
print(r)


N = int(input())
(S, T) = list(input().split())
new_str = []
for i in range(0, N):
	new_str.append(S[i] + T[i])
print(''.join(new_str))


N = int(input())
(s, t) = input().split()
u = ''.join((i + j for (i, j) in zip(s, t)))
print(u)


n = int(input())
(s, t) = input().split()
st_mix = []
for i in range(0, n):
	st_mix.append(s[i] + t[i])
print(''.join(st_mix))


n = input()
(s, t) = input().split()
for (s1, t1) in zip(s, t):
	print(s1, t1, sep='', end='')


(_, s) = open(0)
print(''.join(sum(zip(*s.split()), ())))


a = int(input())
(s, t) = input().split()
print(''.join((s[i] + t[i] for i in range(a))))


n = int(input())
(s, t) = input().split()
for k in range(n):
	print(s[k] + t[k], end='')


n = int(input())
(a, b) = input().split()
c = ''
for i in range(n):
	c += a[i] + b[i]
print(c)


n = int(input())
(a, b) = input().split()
for i in range(n):
	print(a[i] + b[i], end='')


N = int(input())
(S, T) = input().split()
c = ''
for i in range(N):
	c += S[i] + T[i]
print(c)


a = int(input())
(b, c) = input().split()
d = ''
for i in range(a):
	d = d + b[i] + c[i]
print(d)


n = int(input())
a = ''
t = input().split()
for i in range(n):
	a += t[0][i] + t[1][i]
print(a)


input()
(s, t) = list(input().split())
for (ss, tt) in zip(s, t):
	print(ss + tt, end='')


N = int(input())
(S, T) = input().split()
print(''.join(map(lambda s, t: s + t, S, T)))


N = int(input())
(S, T) = map(str, input().split())
kougo = ''
for (s, t) in zip(S, T):
	kougo += s + t
print(kougo)


n = int(input())
(S, T) = input().split()
for i in range(n):
	print(S[i] + T[i], end='')


N = int(input())
(S, T) = input().split()
for n in range(N):
	print(S[n] + T[n], end='')


n = int(input())
(s, t) = input().split()
out = ''
for i in range(n):
	out += s[i] + t[i]
print(out)


n = int(input())
(s, t) = input().split()
result = ''
for i in range(n):
	result += s[i] + t[i]
print(result)


n = int(input())
(s, t) = input().split()
d = ''
for i in range(n):
	d += s[i]
	d += t[i]
print(d)


N = int(input())
(S, T) = input().split()
character = list()
for i in range(N):
	character.append(S[i])
	character.append(T[i])
answer = ''.join(character)
print(answer)


input()
(S, T) = input().split()
for (i, j) in zip(S, T):
	print(i + j, end='')


n = int(input())
(x, y) = input().split()
z = ''
for i in range(n):
	z += x[i]
	z += y[i]
print(z)


n = int(input())
(s, t) = map(str, input().split(' '))
for (i, j) in zip(s, t):
	print(i + j, end='')


N = int(input())
(a, b) = input().split()
ans = ''
for i in range(N):
	ans += a[i] + b[i]
print(ans)


(_, s) = open(0)
j = ''.join
print(j(map(j, zip(*s.split()))))


n = int(input())
s = input()
print(''.join([s[(n + 1) * i % (2 * n + 1)] for i in range(0, 2 * n)]))


n = int(input())
(s, t) = input().split()
ans = []
ss = list(s)
tt = list(t)
for i in range(n):
	ans.append(ss[i])
	ans.append(tt[i])
print(''.join(ans))


input()
(S, T) = input().split()
print(*[i + j for (i, j) in zip(S, T)], sep='')


a = int(input())
(s, d) = input().split()
z = ''
for i in range(a):
	z += s[i]
	z += d[i]
print(z)


N = int(input())
(S, T) = map(str, input().split())
res_list = []
for a in range(N):
	res_list.append(S[a])
	res_list.append(T[a])
	a += 1
print(''.join(res_list))


input()
(S, T) = input().split()
for (a, b) in zip(S, T):
	print(a + b, end='')


n = int(input())
(a, b) = map(str, input().split())
for (i, j) in zip(a, b):
	print(i + j, end='')


n = int(input())
(a, b) = input().split()
ans = ''
for i in range(n):
	ans += a[i] + b[i]
print(ans)


n = int(input())
(s, t) = input().split()
i = 0
while i < n:
	print(s[i] + t[i], end='')
	i += 1


N = int(input())
(K, X) = input().split()
print(*[K[i] + X[i] for i in range(N)], sep='')


N = int(input())
(S, T) = input().split()
print(''.join([X + Y for (X, Y) in zip(S, T)]))


input()
(s, t) = input().split()
for (i, j) in zip(s, t):
	print(i, j, sep='', end='')


def main():
	_ = int(input())
	(S, T) = input().split()
	ans = ''
	for (s, t) in zip(S, T):
		ans += s + t
	print(ans)

def __starting_point():
	main()
__starting_point()


input()
print(''.join((lambda x: (x[0][i] + x[1][i] for i in range(len(x[0]))))(input().split())))


num = input()
(s, t) = input().split()
for (j, k) in zip(s, t):
	print(j + k, end='')


n = int(input())
s = input().replace(' ', '')
print(''.join([s[i::n] for i in range(n)]))


N = int(input())
(S, T) = input().split()
A = ''
for i in range(N):
	A = A + S[i] + T[i]
print(A)


n = int(input())
(S, T) = input().split()
A = ''
for i in range(n):
	A += S[i] + T[i]
print(A)


n = int(input())
(s, t) = input().split()
ans = ''
for (x, y) in zip(s, t):
	ans += x + y
print(ans)


n = int(input())
(s, t) = input().split()
new = ''
for i in range(n):
	new += s[i]
	new += t[i]
print(new)


input()
(s, t) = input().split()
print(''.join((x + y for (x, y) in zip(s, t))))


N = int(input())
(S, T) = input().split()

def new():
	text = []
	for i in range(N):
		text.append(S[i])
		text.append(T[i])
	return ''.join(text)
print(new())


input()
(s, t) = input().split()
l = [c1 + c2 for (c1, c2) in zip(s, t)]
print(''.join(l))


n = int(input())
(s, t) = input().split()
print(''.join([c1 + c2 for (c1, c2) in zip(s, t)]))


N = int(input())
(S, T) = input().split()
answer = ''
for i in range(N):
	answer = answer + S[i] + T[i]
print(answer)


input()
(S, T) = input().split()
print(''.join([a + b for (a, b) in zip(S, T)]))


N = int(input())
(S, T) = input().split()
X = ''
for n in range(N):
	X += S[n] + T[n]
print(X)


N = int(input())
(S, T) = list(map(str, input().split()))

def ans148(N: int, S: str, T: str):
	newstr = ''
	for i in range(0, N):
		newstr = newstr + S[i] + T[i]
	return newstr
print(ans148(N, S, T))