rudude
January 13, 2020, 6:49pm
1
#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;
}
ssjgz
January 13, 2020, 7:02pm
2
Please either format your code or link to your submission - the forum software has mangled it and it won’t compile!
Edit:
I guess it’s not too broken. Consider the testcase:
1
ccabbcabab
3 Likes
bit_21
January 13, 2020, 7:03pm
3
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.
rudude
January 14, 2020, 7:04pm
4
Thank you,I just figured out i misunderstood the maximal strings concept
1 Like