[알고리즘] pair
pair, sort 를 사용하기 #include #include #include using namespace std; int main(){ vector vc; for (int i = 0; i < 5; i++) { vc.push_back(make_pair(1, 5)); vc.push_back(make_pair(1, 3)); vc.push_back(make_pair(2, 4)); vc.push_back(make_pair(2, 3)); vc.push_back(make_pair(3, 3)); vc.push_back(make_pair(3, 2)); vc.push_back(make_pair(4, 2)); vc.push_back(make_pair(5, 1)); } sort(vc.begin(), vc.end()); /..
2020. 3. 21.