In the registration system problem from Code forces beta round #4 it is given that the number of character in a string are not more than 32.but when i use a string of size exactly 32 character i get a wrong answer on 13 test case.and if i use s[33] my solution is accepted.can i know where I am going wrong.↵
↵
This is my code-↵
~~~~~↵
Your code here...↵
~~~~~↵
#include<stdio.h>↵
#include<string.h>↵
int main(){↵
int n,i,j,l=0;↵
scanf("%d",&n);↵
int b[1000000]={0};↵
char s[323],a[n][323];↵
for(i=0;i<n;i++){↵
scanf("%s",s);↵
for(j=0;j<l;j++){↵
if(strcmp(a[j],s)==0){↵
b[j]++;↵
break;↵
}↵
}↵
if(j>=l){↵
l++;↵
printf("OK\n");↵
strcpy(a[j],s);↵
}↵
else{↵
printf("%s%d\n",s,b[j]);↵
}↵
↵
↵
↵
}↵
return 0;↵
}↵
↵
↵
This is my code-↵
Your code here...↵
~~~~~↵
#include<stdio.h>↵
#include<string.h>↵
int main(){↵
int n,i,j,l=0;↵
scanf("%d",&n);↵
int b[1000000]={0};↵
char s[3
for(i=0;i<n;i++){↵
scanf("%s",s);↵
for(j=0;j<l;j++){↵
if(strcmp(a[j],s)==0){↵
b[j]++;↵
break;↵
}↵
}↵
if(j>=l){↵
l++;↵
printf("OK\n");↵
strcpy(a[j],s);↵
}↵
else{↵
printf("%s%d\n",s,b[j]);↵
}↵
↵
↵
↵
}↵
return 0;↵
}↵
↵
↵



