
```cpp
#include<iostream>
#include<stack>
using namespace std;
stack<int>s;
int main()
{
int num,number,x;
int flag = 0;
cin >> num;
for (int i = 1; i <= num; i++) {
cin >> number;
for (int j = 1; j <= number; j++) {
cin >> x;
s.push(x);
}
while (!s.empty()) {
cin >> x;
if (s.top() != x) {
flag = 1;
s.pop();
}
else
s.pop();
}
if (!flag) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
flag = 0;
while (!s.empty())
s.pop();
}
}
```
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/257220.html
標籤:C++ 語言
下一篇:表單應用程式大佬們幫忙看看
