A9227 | Dima and Text Messages
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Seryozha has a very changeable character. This time he refused to leave the room to Dima and his girlfriend (her hame is Inna, by the way). However, the two lovebirds can always find a way to communicate. Today they are writing text messages to each other.
Dima and Inna are using a secret code in their text messages. When Dima wants to send Inna some sentence, he writes out all words, inserting a heart before each word and after the last word. A heart is a sequence of two characters: the "less" characters (<) and the digit three (3). After applying the code, a test message looks like that: <3 $word_{1}$ <3 $word_{2}$ <3 ... $word_{n}$ <3.
Encoding doesn't end here. Then Dima inserts a random number of small English characters, digits, signs "more" and "less" into any places of the message.
Inna knows Dima perfectly well, so she knows what phrase Dima is going to send her beforehand. Inna has just got a text message. Help her find out if Dima encoded the message correctly. In other words, find out if a text message could have been received by encoding in the manner that is described above.
Dima and Inna are using a secret code in their text messages. When Dima wants to send Inna some sentence, he writes out all words, inserting a heart before each word and after the last word. A heart is a sequence of two characters: the "less" characters (<) and the digit three (3). After applying the code, a test message looks like that: <3 $word_{1}$ <3 $word_{2}$ <3 ... $word_{n}$ <3.
Encoding doesn't end here. Then Dima inserts a random number of small English characters, digits, signs "more" and "less" into any places of the message.
Inna knows Dima perfectly well, so she knows what phrase Dima is going to send her beforehand. Inna has just got a text message. Help her find out if Dima encoded the message correctly. In other words, find out if a text message could have been received by encoding in the manner that is described above.
输入格式
The first line contains integer $n$ $(1<=n<=10^{5})$ — the number of words in Dima's message. Next $n$ lines contain non-empty words, one word per line. The words only consist of small English letters. The total length of all words doesn't exceed $10^{5}$ .
The last line contains non-empty text message that Inna has got. The number of characters in the text message doesn't exceed $10^{5}$ . A text message can contain only small English letters, digits and signs more and less.
The last line contains non-empty text message that Inna has got. The number of characters in the text message doesn't exceed $10^{5}$ . A text message can contain only small English letters, digits and signs more and less.
输出格式
In a single line, print "yes" (without the quotes), if Dima decoded the text message correctly, and "no" (without the quotes) otherwise.
输入输出样例
输入 #1
3 i love you <3i<3love<23you<3
输出 #1
yes
输入 #2
7 i am not main in the family <3i<>3am<3the<3<main<3in<3the<3><3family<3
输出 #2
no
Please note that Dima got a good old kick in the pants for the second sample from the statement.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted