# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148670 | Welcome to osu! (#200) | FunctionCup Museum (FXCUP4_museum) | C++17 | 0 ms | 0 KiB |
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 a[101],b[101],c[101],ab[101][101],bc[101][101],ac[101][101],abc[101][101][101];
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size(), long long ans=0;
for(int i=0; i<N; i++){
ans += a[B[i]]+b[T[i]]+c[G[i]]-ab[B[i]][T[i]]-bc[T[i]][G[i]]-ac[B[i]][G[i]]+abc[B[i]][T[i]][G[i]];
a[B[i]]++;
b[T[i]]++;
c[G[i]]++;
ab[B[i]][T[i]]++;
bc[T[i]][G[i]]++;
ac[B[i]][G[i]]++;
abc[B[i]][T[i]][G[i]]++;
}
return ans;
}