One Way In, Two Ways Out

查看题解 查看答案
题目描述
Time Limit: 1000 ms
Memory Limit: 256 mb

请先登录再刷题,不会做的题目右上可以查看题解和答案~

输入输出格式
输入描述:
Each input file contains one test case. For each case, the first line gives 2 positive integers N and K (≤10), which are the number of insertions and the number of queries, respectively. Then N distinct numbers are given in the next line, as the insertion sequence. Finally K lines follow, each contains N inserted numbers as the deletion sequence to be checked.
输出描述:
For each deletion sequence, print in a line yes if it is indeed possible to be obtained, or no otherwise.
输入输出样例
输入样例#:
5 4
10 2 3 4 5
10 3 2 5 4
5 10 3 2 4
2 3 10 4 5
3 5 10 4 2
输出样例#:
复制
yes
no
yes
yes
题目来源
浙江大学2021年机试题
重置

提交代码后在此处可查看状态