#include "museum.h"
#include<vector>
using namespace std;
#define ll long long
ll res;
vector<int> v;
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
v = vector<int>(111, 0);
for (int i = 0; i < N; i++)
res += v[B[i]]++;
v = vector<int>(111, 0);
for (int i = 0; i < N; i++)
res += v[T[i]]++;
v = vector<int>(111, 0);
for (int i = 0; i < N; i++)
res += v[G[i]]++;
v = vector<int>(11111, 0);
for (int i = 0; i < N; i++)
res -= v[B[i] * 101 + T[i]]++;
v = vector<int>(11111, 0);
for (int i = 0; i < N; i++)
res -= v[B[i] * 101 + G[i]]++;
v = vector<int>(11111, 0);
for (int i = 0; i < N; i++)
res -= v[T[i] * 101 + G[i]]++;
v = vector<int>(1111111, 0);
for (int i = 0; i < N; i++)
res += v[B[i] * 10203 + T[i] * 101 + G[i]]++;
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
4864 KB |
Output is correct |
2 |
Correct |
7 ms |
4864 KB |
Output is correct |
3 |
Correct |
8 ms |
4864 KB |
Output is correct |
4 |
Correct |
8 ms |
4864 KB |
Output is correct |
5 |
Correct |
7 ms |
4608 KB |
Output is correct |
6 |
Correct |
8 ms |
4824 KB |
Output is correct |
7 |
Correct |
8 ms |
4864 KB |
Output is correct |
8 |
Correct |
9 ms |
4864 KB |
Output is correct |
9 |
Correct |
8 ms |
4864 KB |
Output is correct |
10 |
Correct |
9 ms |
4864 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
4864 KB |
Output is correct |
2 |
Correct |
7 ms |
4864 KB |
Output is correct |
3 |
Correct |
8 ms |
4864 KB |
Output is correct |
4 |
Correct |
8 ms |
4864 KB |
Output is correct |
5 |
Correct |
7 ms |
4608 KB |
Output is correct |
6 |
Correct |
8 ms |
4824 KB |
Output is correct |
7 |
Correct |
8 ms |
4864 KB |
Output is correct |
8 |
Correct |
9 ms |
4864 KB |
Output is correct |
9 |
Correct |
8 ms |
4864 KB |
Output is correct |
10 |
Correct |
9 ms |
4864 KB |
Output is correct |
11 |
Correct |
10 ms |
4992 KB |
Output is correct |
12 |
Correct |
19 ms |
5504 KB |
Output is correct |
13 |
Correct |
30 ms |
6132 KB |
Output is correct |
14 |
Correct |
41 ms |
6768 KB |
Output is correct |
15 |
Correct |
58 ms |
7664 KB |
Output is correct |
16 |
Correct |
78 ms |
9572 KB |
Output is correct |
17 |
Correct |
84 ms |
9324 KB |
Output is correct |
18 |
Correct |
88 ms |
9580 KB |
Output is correct |
19 |
Correct |
88 ms |
9572 KB |
Output is correct |
20 |
Correct |
90 ms |
9576 KB |
Output is correct |