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"
using std::vector;
typedef long long lint;
int A[100], B[100], C[100];
int D[100][100], E[100][100], F[100][100];
int G[100][100][100];
lint CountSimilarPairs(vector<int> X, vector<int> Y, vector<int> Z) {
int n = X.size();
for(int i=0; i<n; i++){
int x=X[i]-1, y=Y[i]-1, z=Z[i]-1;
A[x]++, B[y]++, C[z]++;
D[x][y]++, E[y][z]++, F[z][x]++;
G[x][y][z]++;
}
lint ans = 0;
for(int i=0; i<n; i++){
int x=X[i]-1, y=Y[i]-1, z=Z[i]-1;
int now = A[x] + B[y] + C[z];
now -= D[x][y] + E[y][z] + F[z][x];
now += G[x][y][z];
now -= 1;
ans += now;
}
return ans/2;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |