Submission #148477

#TimeUsernameProblemLanguageResultExecution timeMemory
148477----MIT합격선---- (#200)FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
101 ms9204 KiB
#include "museum.h" using std::vector; typedef long long lint; int A[100], B[100], C[100]; int D[100][100], E[100][100], F[100][100]; int G[100][100][100]; lint CountSimilarPairs(vector<int> X, vector<int> Y, vector<int> Z) { int n = X.size(); for(int i=0; i<n; i++){ int x=X[i]-1, y=Y[i]-1, z=Z[i]-1; A[x]++, B[y]++, C[z]++; D[x][y]++, E[y][z]++, F[z][x]++; G[x][y][z]++; } lint ans = 0; for(int i=0; i<n; i++){ int x=X[i]-1, y=Y[i]-1, z=Z[i]-1; int now = A[x] + B[y] + C[z]; now -= D[x][y] + E[y][z] + F[z][x]; now += G[x][y][z]; now -= 1; ans += now; } return ans/2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...