# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151971 | minty99 | FunctionCup Museum (FXCUP4_museum) | C++17 | 78 ms | 11108 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "museum.h"
#include <stdio.h>
int B_only[101], T_only[101], G_only[101];
int BT[101][101], BG[101][101], TG[101][101];
int BTG[101][101][101];
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
for(int i = 0; i < B.size(); i++)
{
int b = B[i], t = T[i], g = G[i];
B_only[b]++;
T_only[t]++;
G_only[g]++;
BT[b][t]++;
BG[b][g]++;
TG[t][g]++;
BTG[b][t][g]++;
}
long long answer = 0;
for(int i = 0; i < B.size(); i++)
{
int b = B[i], t = T[i], g = G[i];
int nA = B_only[b];
int nB = T_only[t];
int nC = G_only[g];
int nAB = BT[b][t];
int nAC = BG[b][g];
int nBC = TG[t][g];
int nABC = BTG[b][t][g];
long long ans = (long long) nA + nB + nC - nAB - nBC - nAC + nABC - 1;
answer += ans;
}
return answer / 2;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |