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 <bits/stdc++.h>
#include "museum.h"
#define long long long
using namespace std;
map<int, int> Mp[7];
long ans;
int op[] = {1, 1, 1, -1, -1, -1, 1};
long CountSimilarPairs(vector<int> B, vector<int> T, vector<int> G) {
int n = B.size();
for(int i = 0; i < n; ++i) {
vector<int> v(7);
v[0] = B[i]-1, v[1] = T[i]-1, v[2] = G[i]-1;
v[3] = v[0] * 100 + v[1];
v[4] = v[0] * 100 + v[2];
v[5] = v[1] * 100 + v[2];
v[6] = v[0] * 10000 + v[1] * 100 + v[2];
for(int j = 0; j < 7; ++j) {
ans += op[j] * Mp[j][v[j]]++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |