Submission #151873

#TimeUsernameProblemLanguageResultExecution timeMemory
151873tmwilliamlin168FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
185 ms14144 KiB
#include "museum.h" #include <bits/stdc++.h> using namespace std; long long CountSimilarPairs(vector<int> b, vector<int> t, vector<int> g) { long long ans=0; for(int i=1; i<8; ++i) { unordered_map<int, int> mp; for(int j=0; j<b.size(); ++j) { int k=((i&1?b[j]:0)*101+(i&2?t[j]:0))*101+(i&4?g[j]:0); ans+=(mp[k]++)*(__builtin_popcount(i)%2*2-1); } } return ans; }

Compilation message (stderr)

museum.cpp: In function 'long long int CountSimilarPairs(std::vector<int>, std::vector<int>, std::vector<int>)':
museum.cpp:9:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0; j<b.size(); ++j) {
                ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...