Wrong Answer despite correct output I tried every possible test case Problem :https://www.codechef.com/problems/CHEALG

#include <stdio.h>
#include<stdlib.h>
#include <string.h>
int main(void) {
char a[1000000];
int t,i,count,countdigit,len,c[256],j;
scanf("%d",&t);
for(j=0;j<t;j++)
{
for(i=0;i<256;i++)
{
c[i]=0;
}
count=0;
len=0;
scanf("%s",a);
for(i=0;i<strlen(a);i++)
{
c[a[i]]++;
}
for(i=0;i<256;i++)
{
countdigit=0;
if(c[i]!=0)
{
count++;
while(c[i]!=0)
{
c[i]=c[i]/10;
countdigit++;
}
len=countdigit+len;
}
}
len=len+count;
if(len<strlen(a))
printf(“YES\n”);
else
printf(“NO\n”);
}
// your code goes here
return 0;

}

Please either format your code or link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

Edit:

I guess it’s not too broken. Consider the testcase:

1
ccabbcabab
3 Likes

Do not do this brother. Nobody is going to understand your code and then find the missing test case for you. Instead help yourself by viewing the editorial, making a correct code and then generate random inputs and find the conflicting wrong test cases.

Thank you,I just figured out i misunderstood the maximal strings concept

1 Like