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 1880. Psych Up's Eigenvalues

why is the code Time limit exceeded?
Posted by zhao kai 18 Apr 2013 12:20
#include <iostream>

#include <map>
using namespace std;

int main()
{
    map<int,int> table;
    int x,y,sum = 3;
    while(sum--)
    {
        cin >> x;
        while(x--)
        {
            cin >> y;
            table[y]++;
        }
    }
    int s = 0;
    for(int i = 0;i < table.size();i++)
        if(table[i] == 3) s++;
    cout << s;
    return 0;
}