HELP IN Registration system problem

Revision en2, by jweh, 2020-07-12 10:25:47

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 ~~~~~ 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[33],a[n][33]; 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;

}

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English jweh 2020-07-12 10:28:27 600
en2 English jweh 2020-07-12 10:25:47 44
en1 English jweh 2020-07-12 10:19:42 914 Initial revision (published)