#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 |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
636 KB |
Output is correct |
5 |
Correct |
4 ms |
1656 KB |
Output is correct |
6 |
Correct |
4 ms |
2296 KB |
Output is correct |
7 |
Correct |
5 ms |
3068 KB |
Output is correct |
8 |
Correct |
3 ms |
504 KB |
Output is correct |
9 |
Correct |
8 ms |
4164 KB |
Output is correct |
10 |
Correct |
8 ms |
4088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
636 KB |
Output is correct |
5 |
Correct |
4 ms |
1656 KB |
Output is correct |
6 |
Correct |
4 ms |
2296 KB |
Output is correct |
7 |
Correct |
5 ms |
3068 KB |
Output is correct |
8 |
Correct |
3 ms |
504 KB |
Output is correct |
9 |
Correct |
8 ms |
4164 KB |
Output is correct |
10 |
Correct |
8 ms |
4088 KB |
Output is correct |
11 |
Correct |
9 ms |
4856 KB |
Output is correct |
12 |
Correct |
12 ms |
1016 KB |
Output is correct |
13 |
Correct |
27 ms |
5620 KB |
Output is correct |
14 |
Correct |
39 ms |
7088 KB |
Output is correct |
15 |
Correct |
53 ms |
7820 KB |
Output is correct |
16 |
Correct |
69 ms |
5312 KB |
Output is correct |
17 |
Correct |
72 ms |
5220 KB |
Output is correct |
18 |
Correct |
76 ms |
6512 KB |
Output is correct |
19 |
Correct |
82 ms |
9580 KB |
Output is correct |
20 |
Correct |
82 ms |
9712 KB |
Output is correct |