이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "museum.h"
int cnt[105][105][105];
long long res = 0;
long long get(long long s){
return s * (s - 1) / 2;
}
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++){
int a = B[i];
int b = T[i];
int c = G[i];
cnt[a][0][0]++;
cnt[0][b][0]++;
cnt[0][0][c]++;
cnt[a][b][0]++;
cnt[0][b][c]++;
cnt[a][0][c]++;
cnt[a][b][c]++;
}
for(int i = 0; i <= 100; i++){
for(int j = 0; j <= 100; j++){
for(int l = 0; l <= 100; l++){
int t = 3;
if(i == 0) t--;
if(j == 0) t--;
if(l == 0) t--;
res += (t % 2 == 1 ? 1 : -1) * get(cnt[i][j][l]);
}
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |