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;
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
ll ans = 0;
for(int i = 1 ; i <(1<<3) ; i++){
map<array<int, 3 > , int> conta;
for(int j = 0 ; j < N ; j ++){
array<int, 3> X;
X[0] = 0 , X[1] = 0 , X[2] = 0;
if(1<<0 & i){
X[0] = B[j];
}
if(1<<1 & i){
X[1] = T[j];
}
if(1<<2 & i){
X[2] = G[j];
}
ans += conta[X] * ((__builtin_popcount(i) )%2 ? 1 : -1);
conta[X]++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |