This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "museum.h"
#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> BXX, XTX, XXG, BTX, BXG, XTG, BTG;
long long CountSimilarPairs(vector<int> B, vector<int> T, vector<int> G) {
int N = B.size();
long long ans = 0;
for (int i = 0; i < N; i++) {
int b = B[i], t = T[i], g = G[i];
ans += BXX[b]++;
ans += XTX[t]++;
ans += XXG[g]++;
ans -= BTX[b * 1000 + t]++;
ans -= BXG[b * 1000 + g]++;
ans -= XTG[t * 1000 + g]++;
ans += BTG[b * 1000000 + t * 1000 + g]++;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |