|
|
back to boardC++ AC Posted by D4nick 27 Jan 2019 19:59 #include <iostream> #include <map> using namespace std; int main() { int n; cin >> n; map <int, int> m; int d, ans = 0; for (int i = 0; i < n; i++) { cin >> d; auto f = m.find(d); if ( f == m.end()) m.insert(make_pair(d, 1)); else { f->second++; if (f->second % 4 == 0) ans++; } } cout << ans; } Edited by author 30.01.2019 03:14 |
|
|