Submission #150007

#TimeUsernameProblemLanguageResultExecution timeMemory
150007test team (#200)FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
96 ms13420 KiB
#include "museum.h" long long a[101],b[101],c[101],d[101][101],e[101][101],f[101][101],g[101][101][101]; long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) { int n = B.size(); long long ret=0; for(int i=0;i<n;i++) { a[B[i]]++; b[T[i]]++; c[G[i]]++; d[B[i]][T[i]]++; e[B[i]][G[i]]++; f[T[i]][G[i]]++; g[B[i]][T[i]][G[i]]++; } for(int i=1;i<=100;i++) ret+=((a[i]-1)*a[i]+(b[i]-1)*b[i]+(c[i]-1)*c[i])/2; for(int i=1;i<=100;i++) for(int j=1;j<=100;j++) ret-=((d[i][j]-1)*d[i][j]+(e[i][j]-1)*e[i][j]+(f[i][j]-1)*f[i][j])/2; for(int i=1;i<=100;i++) for(int j=1;j<=100;j++) for(int k=1;k<=100;k++) ret+=(g[i][j][k]-1)*g[i][j][k]/2; return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...