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"
bool table[20002][20002];
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
int sol = 0;
for (int i = 0; i < N; i++) {
int candB = B[i];
int candT = T[i];
int candG = G[i];
for (int j = i+1; j < N; j++) {
// ������ continue
if (i == j) {
continue;
}
if (candB == B[j] || candT == T[j] || candG == G[j]) {
// �湮�ߴٸ�
if (table[i][j] == 1 && table[j][i] == 1) {
continue;
}
table[i][j] = table[j][i] = 1;
sol++;
}
}
}
return sol;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |