git mv
다국어
시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 1024 MB | 74 | 24 | 20 | 30.769% |
During development, you recently moved a file from one location to another. To keep your development team up to date with the change you made, you want to send them a short description of the change, without making use of any versioning software.
Both the source location and destination are valid Unix path names, that is, a nonempty string consisting of lowercase letters and "/
" such that no "/
" occurs at the begin or the end, nor does it contain two consecutive forward slashes.
You need to find the shortest string of the form "A{B => C}D
" such that:
ABD
" and the destination is "ACD
", where double forward slashes should be read as one forward slash. For example, if a file is moved from "a/c
" to "a/b/c
", we can describe this movement by "a/{ => b}/c
", meaning the source location was "a/c
" and not "a//c
".The input consists of:
Both lines will contain at most $10^6$ characters, will not begin or end with a forward slash and will not contain any directory name twice. The two strings are guaranteed to be different.
Output the shortest replacement string that transforms the source location to the destination, satisfying the above constraints.
www/public/passwords private/passwords
{www/public => private}/passwords
home/linus/downloads/image home/linus/pictures/recent/image
home/linus/{downloads => pictures/recent}/image
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2021 Preliminaries G번