답안 #150279

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150279 2019-09-01T08:03:14 Z Outfraware Boat People(#3577, c4big, bsyo2k, cepiloth) 함수컵 박물관 (FXCUP4_museum) C++17
컴파일 오류
0 ms 0 KB
#include "museum.h"

typedef std::pair<int, int> PII;
typedef std::set<PII> SETPAIR;

long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
	int N = B.size();
	long long count = 0;

	SETPAIR set_pair;


	for (int i = 0; i < N; ++i) {
		for (int j = i + 1; j < N; ++j) {
			if (B[i] == B[j]) {
				set_pair.insert(PII(i, j));
			}

			if (T[i] == T[j]) {
				set_pair.insert(PII(i, j));
			}

			if (G[i] == G[j]) {
				set_pair.insert(PII(i, j));
			}
		}
	}

	return set_pair.count();
}

Compilation message

museum.cpp:4:14: error: 'set' in namespace 'std' does not name a template type
 typedef std::set<PII> SETPAIR;
              ^~~
museum.cpp: In function 'long long int CountSimilarPairs(std::vector<int>, std::vector<int>, std::vector<int>)':
museum.cpp:10:2: error: 'SETPAIR' was not declared in this scope
  SETPAIR set_pair;
  ^~~~~~~
museum.cpp:16:5: error: 'set_pair' was not declared in this scope
     set_pair.insert(PII(i, j));
     ^~~~~~~~
museum.cpp:20:5: error: 'set_pair' was not declared in this scope
     set_pair.insert(PII(i, j));
     ^~~~~~~~
museum.cpp:24:5: error: 'set_pair' was not declared in this scope
     set_pair.insert(PII(i, j));
     ^~~~~~~~
museum.cpp:29:9: error: 'set_pair' was not declared in this scope
  return set_pair.count();
         ^~~~~~~~
museum.cpp:8:12: warning: unused variable 'count' [-Wunused-variable]
  long long count = 0;
            ^~~~~