min max 함수가 algorithm 헤더파일에 있는것으로 알고 있는데 algorithm 헤더를 사용하지 않아도 사용이 가능한 이유를 알고 싶습니다.
1 2 3 4 5 6 7 8 9 10 #include <vector> #include <set> using namespace std; int solution(vector<int> nums) { set<int> s; for(int n : nums) s.insert(n); return min(nums.size() / 2, s.size()); }
1 2 3 4 5 6 7 8 9 10
#include <vector> #include <set> using namespace std; int solution(vector<int> nums) { set<int> s; for(int n : nums) s.insert(n); return min(nums.size() / 2, s.size()); }