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 ap[105][105][105];
int i;
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
long long ans=0;
for(i=0;i<N;i++)
{
long long coef=(ap[B[i]][0][0]+ap[0][T[i]][0]+ap[0][0][G[i]]-ap[B[i]][T[i]][0]-ap[B[i]][0][G[i]]-ap[0][T[i]][G[i]]+ap[B[i]][T[i]][G[i]]);
ans+=(coef);
ap[B[i]][0][0]++;
ap[0][T[i]][0]++;
ap[0][0][G[i]]++;
ap[B[i]][T[i]][0]++;
ap[B[i]][0][G[i]]++;
ap[0][T[i]][G[i]]++;
ap[B[i]][T[i]][G[i]]++;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |