Page 1 of 1

10679-I Love String!!! - Shallow judge data

Posted: Sun Aug 19, 2007 5:37 pm
by A1
this code gets AC!:

Code: Select all

#include <stdio.h>
#include <string.h>

#define MAX 100010

int main()
{
	char S[MAX],q[1010],c;
	int i,j,query,test;

	scanf("%d%c",&test,&c);
	while( test-- )
	{
		gets(S);	
		scanf("%d%c",&query,&c);
		while( query-- )
		{
			gets(q);
			j = 0;
			for( i=0; q[i]; i++ )
			{
				if( q[i] != S[i] )
				{
					j = 1;
					break;
				}
			}
			if( j )
				printf("n\n");
			else
				printf("y\n");
		}
		
	}

	return 0;
}
Which is totaly wrong! because It assumes that every query string will be found from index 0, but In the problem statement it is not mentioned any where! and from the common sense it is understandable that the query string could be found at any where in the main text.

Re: 10679-I Love String!!! - Shallow judge data

Posted: Sun Jul 08, 2012 1:10 pm
by Quantris
Has this been fixed? I don't want to submit to find out since it would surely overwrite my current (legitimate) ranking. I couldn't find any post by Carlos noting that this issue was addressed.

Re: 10679-I Love String!!! - Shallow judge data

Posted: Mon Jul 16, 2012 2:31 pm
by Carlos
No, I don't think this problem is fixed yet....

Re: 10679-I Love String!!! - Shallow judge data

Posted: Mon Dec 10, 2012 7:19 am
by jack9091
You are right problem is still there ...