Submission #151873

# Submission time Handle Problem Language Result Execution time Memory
151873 2019-09-05T08:41:57 Z tmwilliamlin168 FunctionCup Museum (FXCUP4_museum) C++17
100 / 100
185 ms 14144 KB
#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

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 time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 3 ms 376 KB Output is correct
6 Correct 3 ms 380 KB Output is correct
7 Correct 3 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 4 ms 508 KB Output is correct
10 Correct 4 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 3 ms 376 KB Output is correct
6 Correct 3 ms 380 KB Output is correct
7 Correct 3 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 4 ms 508 KB Output is correct
10 Correct 4 ms 504 KB Output is correct
11 Correct 8 ms 760 KB Output is correct
12 Correct 19 ms 1272 KB Output is correct
13 Correct 52 ms 5088 KB Output is correct
14 Correct 77 ms 6192 KB Output is correct
15 Correct 117 ms 10228 KB Output is correct
16 Correct 102 ms 6388 KB Output is correct
17 Correct 110 ms 6392 KB Output is correct
18 Correct 140 ms 10704 KB Output is correct
19 Correct 185 ms 14144 KB Output is correct
20 Correct 184 ms 14076 KB Output is correct