Submission #148374

#TimeUsernameProblemLanguageResultExecution timeMemory
148374Dopatii (#200)FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
103 ms9580 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...