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

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

Postby A1 » Sun Aug 19, 2007 5:37 pm

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.
User avatar
A1
Experienced poster
 
Posts: 173
Joined: Wed Jan 28, 2004 3:34 pm
Location: Bangladesh

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

Postby Quantris » Sun Jul 08, 2012 1:10 pm

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.
Quantris
Learning poster
 
Posts: 75
Joined: Sat Dec 27, 2003 4:49 am
Location: Edmonton AB Canada

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

Postby Carlos » Mon Jul 16, 2012 2:31 pm

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.
User avatar
Carlos
System administrator
 
Posts: 1278
Joined: Sat Oct 13, 2001 2:00 am
Location: Valladolid, Spain

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

Postby jack9091 » Mon Dec 10, 2012 7:19 am

You are right problem is still there ...
Jack
jack9091
New poster
 
Posts: 1
Joined: Mon Dec 10, 2012 7:16 am


Return to Bugs and suggestions

Who is online

Users browsing this forum: No registered users and 1 guest