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

What is wrong? WA1
Posted by alexstyle 15 Sep 2013 20:51
#include <conio.h>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <string.h>
using namespace std;
int povtor (char str[31],char mas2[1001][31],int mas2len)
{
    int i;
    for (i=0; i<mas2len; i++) {
        if (strcmp(str,mas2[i])==0)
           return 0;
    }
return 1;
}

int main()
{ int N;
  char mas[1001][31];
  char mas2[1001][31];

  int mas2len=0;

  cin >> N;

  for (int i=0; i<N; i++) {
  cin >> mas[i];
  }

  for (int i=0; i<N; i++) {
      if (povtor(mas[i],mas2,mas2len))
         strcpy(mas2[mas2len++],mas[i]);
  }



  cout << N-mas2len;

getch();
}