#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 |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
640 KB |
Output is correct |
4 |
Correct |
6 ms |
896 KB |
Output is correct |
5 |
Correct |
7 ms |
1920 KB |
Output is correct |
6 |
Correct |
9 ms |
3840 KB |
Output is correct |
7 |
Correct |
12 ms |
5248 KB |
Output is correct |
8 |
Correct |
21 ms |
12288 KB |
Output is correct |
9 |
Correct |
18 ms |
12160 KB |
Output is correct |
10 |
Correct |
16 ms |
12288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
640 KB |
Output is correct |
4 |
Correct |
6 ms |
896 KB |
Output is correct |
5 |
Correct |
7 ms |
1920 KB |
Output is correct |
6 |
Correct |
9 ms |
3840 KB |
Output is correct |
7 |
Correct |
12 ms |
5248 KB |
Output is correct |
8 |
Correct |
21 ms |
12288 KB |
Output is correct |
9 |
Correct |
18 ms |
12160 KB |
Output is correct |
10 |
Correct |
16 ms |
12288 KB |
Output is correct |
11 |
Correct |
80 ms |
52716 KB |
Output is correct |
12 |
Runtime error |
41 ms |
58112 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
13 |
Halted |
0 ms |
0 KB |
- |