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"
int cnt[105][105][105];
long long res = 0;
long long get(long long s){
return s * (s - 1) / 2;
}
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int n = B.size();
for(int i = 0; i < n; i++){
int a = B[i];
int b = T[i];
int c = G[i];
cnt[a][0][0]++;
cnt[0][b][0]++;
cnt[0][0][c]++;
cnt[a][b][0]++;
cnt[0][b][c]++;
cnt[a][0][c]++;
cnt[a][b][c]++;
}
for(int i = 0; i <= 100; i++){
for(int j = 0; j <= 100; j++){
for(int l = 0; l <= 100; l++){
int t = 3;
if(i == 0) t--;
if(j == 0) t--;
if(l == 0) t--;
res += (t % 2 == 1 ? 1 : -1) * get(cnt[i][j][l]);
}
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |