提交时间:2022-08-18 11:06:28
运行 ID: 55457
#include<bits/stdc++.h> using namespace std; int t,n,m,x,y; int p[100005],f[100005]; inline long long read(){ register long long x=0,f=0; register char t=getchar(); while(t<'0'||t>'9')f^=(t=='-'),t=getchar(); while(t>='0'&&t<='9')x=(x<<3)+(x<<1)+(t^48),t=getchar(); return f?-x:x; } int main(){ t=read(); while(t--){ n=read(),m=read(); for(int i=1;i<=n;i++) p[i]=read(); for(int i=1;i<=n;i++) f[i]=read(); for(int i=1;i<n;i++) x=read(),y=read(); printf("Yes\n"); } return 0; }