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;
typedef long long ll;
int A[105], B[105], C[105], AB[105][105], BC[105][105], AC[105][105], ABC[105][105][105];
long long CountSimilarPairs(vector<int> X, vector<int> Y, vector<int> Z) {
int N = X.size();
ll ans = 0;
for(int i=0;i<N;i++) {
ans += A[X[i]]++ + B[Y[i]]++ + C[Z[i]]++ - AB[X[i]][Y[i]]++ - BC[Y[i]][Z[i]]++ - AC[X[i]][Z[i]]++ + ABC[X[i]][Y[i]][Z[i]]++;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |