Submission #148578

# Submission time Handle Problem Language Result Execution time Memory
148578 2019-09-01T04:42:08 Z Little Piplup(#3742, gratus907, DHdroid, coffeetea99) FunctionCup Museum (FXCUP4_museum) C++17
0 / 100
11 ms 3712 KB
#include "museum.h"

long long countB[111],countT[111],countG[111];
long long countBT[10101],countBG[10101],countTG[10101];
long long countBTG[1010101];
inline long long ct(long long x)
{
	return x*(x-1)/2;
}
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
	int N = B.size();
	long long ans = 0;
	for (int i = 0; i<N; i++)
	{
		countB[B[i]]++;
		countT[T[i]]++;
		countG[G[i]]++;
		countBT[B[i]*100+T[i]]++;
		countBG[B[i]*100+G[i]]++;
		countTG[T[i]*100+G[i]]++;
		countBTG[B[i]*10000+T[i]*100+G[i]]++;
	}
	for (int i = 1; i<=100; i++)
	{
		ans += (ct(countB[i]));
		ans += (ct(countG[i]));
		ans += (ct(countT[i]));
	}
	for (int i = 1; i<=10000; i++)
	{
		ans -= ct(countBT[i]);
		ans -= ct(countBG[i]);
		ans -= ct(countTG[i]);
	}
	for (int i = 1; i<=1000000; i++)
		ans += ct(countBTG[i]);
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 9 ms 384 KB Output is correct
2 Correct 9 ms 384 KB Output is correct
3 Correct 8 ms 360 KB Output is correct
4 Correct 9 ms 768 KB Output is correct
5 Correct 9 ms 2048 KB Output is correct
6 Correct 11 ms 2864 KB Output is correct
7 Incorrect 10 ms 3712 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 384 KB Output is correct
2 Correct 9 ms 384 KB Output is correct
3 Correct 8 ms 360 KB Output is correct
4 Correct 9 ms 768 KB Output is correct
5 Correct 9 ms 2048 KB Output is correct
6 Correct 11 ms 2864 KB Output is correct
7 Incorrect 10 ms 3712 KB Output isn't correct
8 Halted 0 ms 0 KB -