Submission #149709

#TimeUsernameProblemLanguageResultExecution timeMemory
149709GucciBelt (#200)FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
452 ms15080 KiB
#include <bits/stdc++.h> #include "museum.h" #define long long long using namespace std; map<int, int> Mp[7]; long ans; int op[] = {1, 1, 1, -1, -1, -1, 1}; long CountSimilarPairs(vector<int> B, vector<int> T, vector<int> G) { int n = B.size(); for(int i = 0; i < n; ++i) { vector<int> v(7); v[0] = B[i]-1, v[1] = T[i]-1, v[2] = G[i]-1; v[3] = v[0] * 100 + v[1]; v[4] = v[0] * 100 + v[2]; v[5] = v[1] * 100 + v[2]; v[6] = v[0] * 10000 + v[1] * 100 + v[2]; for(int j = 0; j < 7; ++j) { ans += op[j] * Mp[j][v[j]]++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...