#include "museum.h"
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
int similar[200001]={};
int ans = 0;
for(int i=0;i<N;i++){
for(int j=i+1;j<N;j++){
if(B[i] == B[j] && !similar[i]){
similar[i] = 1;
ans++;
continue;
}
if(T[i] == T[j] && !similar[i]){
similar[i] = 1;
ans++;
continue;
}
if(G[i] == G[j] && !similar[i]){
similar[i] = 1;
ans++;
continue;
}
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
1152 KB |
Output is correct |
2 |
Incorrect |
6 ms |
1152 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
1152 KB |
Output is correct |
2 |
Incorrect |
6 ms |
1152 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |