F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Combine String

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)
Total Submission(s): 7160    Accepted Submission(s): 1980


Problem Description
Given three strings $a$, $b$ and $c$, your mission is to check whether $c$ is the combine string of $a$ and $b$.
A string $c$ is said to be the combine string of $a$ and $b$ if and only if $c$ can be broken into two subsequences, when you read them as a string, one equals to $a$, and the other equals to $b$.
For example, ``adebcf'' is a combine string of ``abc'' and ``def''.
 

Input
Input file contains several test cases (no more than 20). Process to the end of file.
Each test case contains three strings $a$, $b$ and $c$ (the length of each string is between 1 and 2000).
 

Output
For each test case, print ``Yes'', if $c$ is a combine string of $a$ and $b$, otherwise print ``No''.
 

Sample Input
abc def adebcf abc def abecdf
 

Sample Output
Yes No
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 14:39:32, Gzip enabled