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

AC
Posted by Baz 5 Nov 2011 20:23
#include <cstdio>
#include <map>

std :: map<int, int> a;
int ans = 0, n, c;

int main() {
        while (scanf("%d", &n) == 1)
                for (; n; n--)
                        scanf("%d", &c), ans += ++a[c] == 3;
        printf("%d", ans);
}

Edited by author 05.11.2011 20:31
Re: AC
Posted by HaiyangZheng 29 Sep 2012 22:08
can you explain the function/name "map" ?
which language used in code above?
Re: AC
Posted by sysu2012zzp 14 Nov 2012 16:58
map is in C++ STL and it is like a binary search tree.
Re: AC
Posted by Egor Stepanov 13 Dec 2012 00:28
amazing solve!!