fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3. int main(void) {
  4. // your code goes here
  5. int a,o,p,g,b,l,e,q,h;
  6. scanf("%d",&a);
  7. char t[256][256];
  8. char v[256][256];
  9. for(int i=1;i<=a;i++)
  10. {
  11. scanf("%d%d",&o,&p);
  12. for(int r=0;r<o;r++)
  13. {
  14. scanf("%s",t[r]);
  15. }
  16. g=0;
  17. for(int w=0;w<p;w++)
  18. {
  19. scanf("%d",&b);
  20. for(e=g;e<b+g;e++)
  21. {
  22. scanf("%s",v[e]);
  23. // printf("%s ",v[e]);
  24.  
  25. }
  26. g=e;
  27. }
  28. for(q=0;q<o;q++)
  29. {l=0;
  30. for(h=0;h<b+g;h++)
  31. {
  32. if(strcmp(t[q],v[h])==0)
  33. {
  34. l=1;
  35. break;
  36. }
  37. // printf("%s ",t[q]);
  38.  
  39. }
  40. if(l==1)
  41. printf("YES ");
  42. else
  43. printf("NO ");
  44. }
  45. printf("\n");
  46.  
  47.  
  48. }
  49. return 0;
  50. }
  51.  
  52.  
Success #stdin #stdout 0s 9440KB
stdin
Standard input is empty
stdout
Standard output is empty