# include <iostream>
# include <algorithm>
# include <cstdio>
using namespace std;
struct Std
{
bool flag;
int a;
};
Std s[10001];
bool cmp(Std x, Std y)
{
return x.a<y.a;
}
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int temp;
for(int i=1; i<=n; i++)
{
cin>>temp;
if(temp==0) s[i].flag=false;
else s[i].flag=true;
}
for(int i=1; i<=n; i++)
{
cin>>s[i].a;
}
sort(s+1, s+n+1, cmp);
for(int i=1; i<=n; i++)
{
if(s[i].flag==false) cout<<s[i].a<<' ';
}
cout<<endl;
for(int i=1; i<=n; i++)
{
if(s[i].flag==true) cout<<s[i].a<<' ';
}
}
return 0;
}
哪位大佬知道哪里出问题了吗
SZO