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(int N, vector<int> B_, vector<int> T_, vector<int> G_) {
for(int i=0; i<N; i++){
int B=B_[i], T=T_[i], G=G_[i];
sum += Bs[B]+Ts[T]+Gs[G];
Bs[B]++, Ts[T]++, Gs[G]++;
sum -= BT[B][T]+TG[T][G]+BG[B][G];
BT[B][T]++, TG[T][G]++, BG[B][G]++;
sum += BTG[B][T][G];
BTG[B][T][G]++;
}
return sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |