Submission #148495

#TimeUsernameProblemLanguageResultExecution timeMemory
148495还没编好 (#200)FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
566 ms17388 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(); map<int,int> sb[8]; vector<int> S[3]={B,T,G}; for(int i=0;i<N;++i) { for(int j=1;j<8;++j) { int w=0; for(int k=0;k<3;++k) if(j&(1<<k)) w=w*233+S[k][i]; ++sb[j][w]; } } long long a=0; for(int j=1;j<8;++j) { int k=-1; if(__builtin_popcount(j)&1) k=1; for(auto t:sb[j]) a+=t.second*(ll)(t.second-1)/2*k; } return a; } #ifdef LOCAL #include "grader.cpp" #endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...