ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1563. Bayan

WA 1
Posted by jhgkhdlkjsgfsjhfdhkhj 28 Mar 2008 22:29
Please,help!My program out 3 in example,maybe,as in a test #1,but i have WA!


# include <string.h>
# include <iostream.h>
#include <stdio.h>
int main()
{
char a[100][31];
int b[100];
int N,i,j,k,h,counter;
cin>>N;
counter=0;
if (0<=N && 1000>=N)
{
  for (i=0;i<N;i++)
  {
   cin.getline(a[i],1000);
   //j++;
   cin>>a[i][j];
   b[i]=1;
  }
  for (i=0;i<N;i++)
  {
    b[i]=0;
    for (j=i;j<N;j++)

      if ((strcmp(a[i],a[j])==0)&&(b[j]==1))
      {
    counter++;
        b[j]=0;
      }


  }
//printf("%d\n",counter);
counter++;
cout<<counter<<endl;
}
return 0;
}
Re: WA 1
Posted by Rustambek_UWED 24 Apr 2008 21:06
Hey
read carefully
instead of:
char a[100][31];
write
char a[1001][31];