Submission #149976

#TimeUsernameProblemLanguageResultExecution timeMemory
149976test team (#200)FunctionCup Museum (FXCUP4_museum)C++17
Compilation error
0 ms0 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+=(f[i][j][k]-1])*f[i][j][k]/2; return ret; }

Compilation message (stderr)

museum.cpp: In function 'long long int CountSimilarPairs(std::vector<int>, std::vector<int>, std::vector<int>)':
museum.cpp:17:36: error: expected ')' before ']' token
         ret+=((a[i]-1)*a[i]+(b[i]-1])*b[i]+(c[i]-1)*c[i])/2;
                                    ^
museum.cpp:17:60: error: expected ')' before ';' token
         ret+=((a[i]-1)*a[i]+(b[i]-1])*b[i]+(c[i]-1)*c[i])/2;
                                                            ^
museum.cpp:20:49: error: expected ')' before ']' token
             ret-=((d[i][j]-1)*d[i][j]+(e[i][j]-1])*e[i][j]+(f[i][j]-1)*f[i][j])/2;
                                                 ^
museum.cpp:20:82: error: expected ')' before ';' token
             ret-=((d[i][j]-1)*d[i][j]+(e[i][j]-1])*e[i][j]+(f[i][j]-1)*f[i][j])/2;
                                                                                  ^
museum.cpp:24:32: error: invalid types 'long long int[int]' for array subscript
                 ret+=(f[i][j][k]-1])*f[i][j][k]/2;
                                ^
museum.cpp:24:35: error: expected ')' before ']' token
                 ret+=(f[i][j][k]-1])*f[i][j][k]/2;
                                   ^