#include "museum.h"
int graph[2020][2020];
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
for (int i = 0; i<N; i++)
{
for (int j = i+1; j<N; j++)
{
if (B[i]==B[j] || T[i]==T[j] || G[i] == G[j])
{
graph[i][j] = 1;
}
}
}
long long ans = 0;
for (int i = 0; i<N; i++)
{
for (int j = i+1; j<N; j++)
{
ans += graph[i][j];
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
12 ms |
556 KB |
Output is correct |
4 |
Correct |
6 ms |
896 KB |
Output is correct |
5 |
Correct |
6 ms |
1792 KB |
Output is correct |
6 |
Correct |
9 ms |
4480 KB |
Output is correct |
7 |
Correct |
10 ms |
5760 KB |
Output is correct |
8 |
Correct |
23 ms |
14208 KB |
Output is correct |
9 |
Correct |
20 ms |
13824 KB |
Output is correct |
10 |
Correct |
18 ms |
13824 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
12 ms |
556 KB |
Output is correct |
4 |
Correct |
6 ms |
896 KB |
Output is correct |
5 |
Correct |
6 ms |
1792 KB |
Output is correct |
6 |
Correct |
9 ms |
4480 KB |
Output is correct |
7 |
Correct |
10 ms |
5760 KB |
Output is correct |
8 |
Correct |
23 ms |
14208 KB |
Output is correct |
9 |
Correct |
20 ms |
13824 KB |
Output is correct |
10 |
Correct |
18 ms |
13824 KB |
Output is correct |
11 |
Runtime error |
33 ms |
16504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Halted |
0 ms |
0 KB |
- |