시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 335 73 56 21.961%

문제

알파벳 소문자로 이루어진 두 문자열 a와 b에 대해, a의 부분 수열의 순열이자 b의 부분 수열의 순열이 되는 가장 긴 문자열 x를 구하여라

입력

각각의 입력은 한 쌍의 줄로 이루어져 있다.

첫 줄에는 문자열 a가 두 번째 줄에는 문자열 b가 주어진다.

각각의 문자열은 줄로 구분되며, 최대 1000개의 알파벳 소문자로 이루어졌다.

출력

각각의 입력에 대해, x를 출력한다.

가능한 x가 여러 개 존재하는 경우, 사전순으로 가장 앞에 오는 것을 출력한다.

예제 입력 1

pretty
women
walking
down
the
street

예제 출력 1

e
nw
et
W3sicHJvYmxlbV9pZCI6IjE2MjIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFjZjVcdWQxYjUgXHVjMjFjXHVjNWY0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM1NGNcdWQzMGNcdWJjYjMgXHVjMThjXHViYjM4XHVjNzkwXHViODVjIFx1Yzc3NFx1YjhlOFx1YzViNFx1YzljNCBcdWI0NTAgXHViYjM4XHVjNzkwXHVjNWY0IGFcdWM2NDAgYlx1YzVkMCBcdWIzMDBcdWQ1NzQsIGFcdWM3NTggXHViZDgwXHViZDg0IFx1YzIxOFx1YzVmNFx1Yzc1OCBcdWMyMWNcdWM1ZjRcdWM3NzRcdWM3OTAgYlx1Yzc1OCZuYnNwO1x1YmQ4MFx1YmQ4NCBcdWMyMThcdWM1ZjRcdWM3NTggXHVjMjFjXHVjNWY0XHVjNzc0IFx1YjQxOFx1YjI5NCBcdWFjMDBcdWM3YTUgXHVhZTM0IFx1YmIzOFx1Yzc5MFx1YzVmNCB4XHViOTdjIFx1YWQ2Y1x1ZDU1OFx1YzVlY1x1Yjc3YzxcL3A+XHJcbiIsImlucHV0IjoiPHA+XHVhYzAxXHVhYzAxXHVjNzU4IFx1Yzc4NVx1YjgyNVx1Yzc0MCBcdWQ1NWMgXHV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GFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

ACM-ICPC > Regionals > North America > Rocky Mountain Regional > Alberta Collegiate Programming Contest > ACPC 1999 F번

  • 문제의 오타를 찾은 사람: cubelover
  • 문제를 번역한 사람: sujin