# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148018 | imsifile | 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"
using namespace std;
int Bs[111], Ts[111], Gs[111], BT[111][111], TG[111][111], BG[111][111], BTG[111][111][111];
long long sum;
long long CountSimilarPairs(vector<int> B, vector<int> T, vector<int> G) {
for(int i=0; i<N; i++){
sum += Bs[B[i]]+Ts[T[i]]+Gs[G[i]];
Bs[B[i]]++, Ts[T[i]]++, Gs[G[i]]++;
sum -= BT[B[i]][T[i]]+TG[T[i]][G[i]]+BG[B[i]][G[i]];
BT[B[i]][T[i]]++, TG[T[i]][G[i]]++, BG[B[i]][G[i]]++;
sum += BTG[B[i]][T[i]][G[i]];
BTG[B[i]][T[i]][G[i]]++;
}
return sum;
}