Submission #150883

#TimeUsernameProblemLanguageResultExecution timeMemory
150883percywtcFunctionCup Museum (FXCUP4_museum)C++17
100 / 100
252 ms15488 KiB
#include "museum.h" #include <bits/stdc++.h> using namespace std; unordered_map<int, int> BXX, XTX, XXG, BTX, BXG, XTG, BTG; long long CountSimilarPairs(vector<int> B, vector<int> T, vector<int> G) { int N = B.size(); long long ans = 0; for (int i = 0; i < N; i++) { int b = B[i], t = T[i], g = G[i]; ans += BXX[b]++; ans += XTX[t]++; ans += XXG[g]++; ans -= BTX[b * 1000 + t]++; ans -= BXG[b * 1000 + g]++; ans -= XTG[t * 1000 + g]++; ans += BTG[b * 1000000 + t * 1000 + g]++; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...