不理解为什么会零分
查看原帖
不理解为什么会零分
728083
wmwycs楼主2023/1/9 20:00
#include <iostream>
using namespace std;
int q,n,pushed[100005],poped;
int main()
{
    cin>>q;
    for(int i=1;i<=q;i++){
        cin>>n;
        bool flag=true;
        for(int j=0;j<n;j++){
            cin>>pushed[n-j];
        }
        for(int j=1;j<=n;j++){
            cin>>poped;
            if(poped!=pushed[j]){
                flag=false;
            }
        }
        if(!flag){
            printf("No\n");
        }else{
            printf("Yes\n");
        }
    }
    return 0;
}
2023/1/9 20:00
加载中...