Submission #148020

#TimeUsernameProblemLanguageResultExecution timeMemory
148020imsifileFunctionCup Museum (FXCUP4_museum)C++17
100 / 100
86 ms11912 KiB
#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) { int N=B.size(); 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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...