답안 #149601

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149601 2019-09-01T06:48:44 Z Outfraware Boat People(#3577, c4big, bsyo2k, cepiloth) 함수컵 박물관 (FXCUP4_museum) C++17
0 / 100
6 ms 384 KB
#include "museum.h"

#include <string>
#include <algorithm>
#include <set>

std::set<std::string> m;

void score(int i, int j) {
	std::string s;
	s.append(std::to_string(i));
	s.append(std::to_string(j));
	sort(s.begin(), s.end());
	m.insert(s);
}


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 candB = B[i];
		int candT = T[i];
		int candG = G[i];
		
		for (int j = 0; j < N; j++) {
			// 같으면 continue
			if (i == j) {
				continue;
			}

			if (candB == B[j]) {
				score(i, j);
			}

			if (candT == T[j]) {
				score(i, j);
			}

			if (candG == G[j]) {
				score(i, j);
			}

		}
	}
	return (long long)m.size();
}

# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Incorrect 6 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Incorrect 6 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -