本地测试都过了!!!但wa*5
查看原帖
本地测试都过了!!!但wa*5
543760
hhb0422楼主2022/1/16 21:18
#include<bits/stdc++.h>
using namespace std;
int a[100001],t;
void push()
{
	t++;
	cin>>a[t];
}
int pop()
{
	if(t==0) return 0;
	t--;
	return a[t+1];
}
int main()
{
	int n,m,q;
	cin>>q;
	for(int i=1;i<=q;i++)
	{
		bool ok=true;
		cin>>m;
		for(int j=0;j<m;j++) push();
		for(int j=0;j<m;j++) 
		{
			cin>>n;
			if(n!=pop()) ok=false;
		}
		if(ok) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}
2022/1/16 21:18
加载中...