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 1496. Spammer

AC C++
Posted by Bogdan Pavlov 4 Feb 2016 00:06
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
int main(){
    int n, active, s = 0;
    bool kek = true;
    cin >> n;
    string *str = new string[n];
    for (int i = 0; i < n; i++)
    {
        cin >> str[i];
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (str[i] == str[j] && i != j){
                str[j] = "1";
                s = 1;
            }

        }
        if (s == 1 && str[i]!="1"){
            cout << str[i] << endl;
        }

        str[i] = "1";
        s = 0;



    }
}

If you can't solve this solution, it may help you.