Competitive Companion到本地的一个案例可以通过,但提交全WA,蒙了!谁可以帮我看一下?
#include <bits/stdc++.h>
using namespace std;
main(){
int q,n;
int a; stack<int> s;
cin >> q;
while(q--){
cin >> n;
for(int i=0;i<n;i++){
cin>>a; s.push(a);
}
for(int i=0;i<n;i++){
cin>>a;
if(a!=s.top()) break;
s.pop();
}
cout << (s.empty()?"Yes":"No") << endl;
while(!s.empty())s.pop();
}
}