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

SODIQJOHN AC [2] // Problem 1880. Psych Up's Eigenvalues 27 Jun 2012 21:29
#include<iostream>
#include<map>
using namespace std;
int main()
{
    map<int,int>a;
    int n,k,i,m,l,p=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
    cin>>k; a[k]++;
    }

    cin>>m;
    for(i=0;i<m;i++)
    {
    cin>>k; a[k]++;
    }

    cin>>l;
    for(i=0;i<l;i++)
    {
    cin>>k; a[k]++;
    if(a[k]==3){p++;}
    }


    cout<<p;

    //system("pause");
    return 0;}
Cảnh Toàn Nguyễn Re: AC // Problem 1880. Psych Up's Eigenvalues 1 Jul 2012 08:56
thanks for sharing your solution.
HaiyangZheng Re: AC // Problem 1880. Psych Up's Eigenvalues 29 Sep 2012 22:15
maybe, a is a very long array.
I understood this method, but I have to worry the MLE...perhaps, "map" is magic...