#include "museum.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int A[105], B[105], C[105], AB[105][105], BC[105][105], AC[105][105], ABC[105][105][105];
long long CountSimilarPairs(vector<int> X, vector<int> Y, vector<int> Z) {
int N = X.size();
ll ans = 0;
for(int i=0;i<N;i++) {
ans += A[X[i]]++ + B[Y[i]]++ + C[Z[i]]++ - AB[X[i]][Y[i]]++ - BC[Y[i]][Z[i]]++ - AC[X[i]][Z[i]]++ + ABC[X[i]][Y[i]][Z[i]]++;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
512 KB |
Output is correct |
4 |
Correct |
5 ms |
640 KB |
Output is correct |
5 |
Correct |
7 ms |
1792 KB |
Output is correct |
6 |
Correct |
8 ms |
2304 KB |
Output is correct |
7 |
Correct |
7 ms |
3072 KB |
Output is correct |
8 |
Correct |
7 ms |
512 KB |
Output is correct |
9 |
Correct |
10 ms |
4224 KB |
Output is correct |
10 |
Correct |
10 ms |
4096 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
512 KB |
Output is correct |
4 |
Correct |
5 ms |
640 KB |
Output is correct |
5 |
Correct |
7 ms |
1792 KB |
Output is correct |
6 |
Correct |
8 ms |
2304 KB |
Output is correct |
7 |
Correct |
7 ms |
3072 KB |
Output is correct |
8 |
Correct |
7 ms |
512 KB |
Output is correct |
9 |
Correct |
10 ms |
4224 KB |
Output is correct |
10 |
Correct |
10 ms |
4096 KB |
Output is correct |
11 |
Correct |
11 ms |
4992 KB |
Output is correct |
12 |
Correct |
16 ms |
1024 KB |
Output is correct |
13 |
Correct |
30 ms |
5588 KB |
Output is correct |
14 |
Correct |
44 ms |
6896 KB |
Output is correct |
15 |
Correct |
73 ms |
7916 KB |
Output is correct |
16 |
Correct |
77 ms |
5224 KB |
Output is correct |
17 |
Correct |
88 ms |
5348 KB |
Output is correct |
18 |
Correct |
90 ms |
6500 KB |
Output is correct |
19 |
Correct |
92 ms |
9700 KB |
Output is correct |
20 |
Correct |
91 ms |
9672 KB |
Output is correct |