페이지

3048번: KOLONE

https://www.acmicpc.net/problem/3048

$O(N+T)$

#include<cstdio>
int n1, n2, t;
char s1[51], s2[51];
int main() {
    scanf("%d%d%s%s%d", &n1, &n2, s1, s2, &t);
    for (int i = 50; i--;) {
        if (s1[i]) putchar(s1[i]);
        if (t >= i && s2[t - i]) putchar(s2[t - i]);
    }
    while (++t < n2) putchar(s2[t]);
    return 0;
}

댓글 없음 :

댓글 쓰기