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

The forum to report every bug you find or tell us what you'd like to find in UVa OJ

Moderator: Board moderators

Post Reply
A1
Experienced poster
Posts: 173
Joined: Wed Jan 28, 2004 3:34 pm
Location: Bangladesh

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

Post 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.

Quantris
Learning poster
Posts: 80
Joined: Sat Dec 27, 2003 4:49 am
Location: Edmonton AB Canada

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

Post 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.

Carlos
System administrator
Posts: 1286
Joined: Sat Oct 13, 2001 2:00 am
Location: Valladolid, Spain
Contact:

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

Post by Carlos »

No, I don't think this problem is fixed yet....
DON'T PM ME --> For any doubt, suggestion or error reporting, please use the "Contact us" form in the web.

jack9091
New poster
Posts: 1
Joined: Mon Dec 10, 2012 7:16 am

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

Post by jack9091 »

You are right problem is still there ...
Jack

Post Reply

Return to “Bugs and suggestions”