Submission #148704

# Submission time Handle Problem Language Result Execution time Memory
148704 2019-09-01T04:58:03 Z distutpia(#3780, cblimmm, wooks1998) FunctionCup Museum (FXCUP4_museum) C++17
0 / 100
8 ms 384 KB
#include "museum.h"

long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
	int N = B.size();
	long long int numB[100];
	long long int numT[100];
	long long int numG[100];
	long long int numBT[10000];
	long long int numBG[10000];
	long long int numTG[10000];
	long long int numBTG[1000000];
	for(int i=0; i<N; i++){
		numB[B[i]]++;
		numT[T[i]]++;
		numG[G[i]]++;
		numBT[100*B[i]+T[i]]++;
		numBG[100*B[i]+G[i]]++;
		numTG[100*T[i]+G[i]]++;
		numBTG[10000*B[i]+100*T[i]+G[i]]++;
	}
	long long int ans=0;
	for(int i=0; i<100; i++){
		ans+=numB[i]*(numB[i]-1);
		ans+=numT[i]*(numT[i]-1);
		ans+=numG[i]*(numG[i]-1);
	}
	for(int i=0; i<10000; i++){
		ans-=numBT[i]*(numBT[i]-1);
		ans-=numBG[i]*(numBG[i]-1);
		ans-=numTG[i]*(numTG[i]-1);
	}
	for(int i=0; i<1000000; i++){
		ans+=(numBTG[i])*(numBTG[i]-1);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -