You are not logged in. Please login at www.codechef.com to post your questions!

×

i don't think my program is wrong

https://www.codechef.com/problems/FRGTNLNG


#include<stdio.h>
#include<string.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,i,j,k,x,y;
        scanf("%d%d",&n,&k);
        char a[n][20];
        for(i=0;i<n;i++)
        {
            scanf("%s",a[i]);
        }
        char b[50][20];
        y=0;
        for(i=0;i<k;i++)
        {
            scanf("%d",&x);
            for(j=0;j<x;j++)
            {scanf("%s",b[y]);
            ++y;
            }
        }
        int flag=0;
        for(i=0;i<n;i++)
        {
            flag=0;
            for(j=0;j<y;j++)
            {
                if(strcmp(a[i],b[j])==0)
                {
                    flag=1;
                    break;
                }
            }
                if(flag==1)
                    printf("Yes ");
                    else
                    printf("No ");
        }
    }
return 0;
}

codechef ide is showing correct output but codechef is giving wrong answer

asked 27 Jun '18, 15:07

puru15's gravatar image

2★puru15
52
accept rate: 0%

edited 27 Jun '18, 15:30

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×148
×145
×8
×2

question asked: 27 Jun '18, 15:07

question was seen: 80 times

last updated: 27 Jun '18, 15:30