Submission #148450

#TimeUsernameProblemLanguageResultExecution timeMemory
148450Solo Leveling (#200)FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
574 ms16492 KiB
#include "museum.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) { int N = B.size(); ll ans = 0; for(int i = 1 ; i <(1<<3) ; i++){ map<array<int, 3 > , int> conta; for(int j = 0 ; j < N ; j ++){ array<int, 3> X; X[0] = 0 , X[1] = 0 , X[2] = 0; if(1<<0 & i){ X[0] = B[j]; } if(1<<1 & i){ X[1] = T[j]; } if(1<<2 & i){ X[2] = G[j]; } ans += conta[X] * ((__builtin_popcount(i) )%2 ? 1 : -1); conta[X]++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...