#include <bits/stdc++.h>
using namespace std;
struct Point {
int y,x;
};
bool cmp(Point & A, Point & B)
{
return A.x > B.x;
};
vector<Point> v;
int main() {
for(int i =10; i >=1; i--)
{
v.push_back({i,10-i});
}
sort(v.begin(),v.end(),cmp);
for(auto it: v) cout << it.y<< " : " << it.x << "\n";
return 0;
}
'프로그래밍지식 > 알고리즘' 카테고리의 다른 글
132 효율적인 해킹 c++ (dfs/bfs) (0) | 2024.03.20 |
---|---|
백준 트럭주차요금 문제 2979 C++ (0) | 2023.12.23 |
백준 10808 알파벳개수 C++ (1) | 2023.12.21 |
백준 2559번 수열 C++로 구하기 feat 누적합 (0) | 2023.10.30 |
ios_base::sync_with_stdio(false) cin.tie(NULL); (0) | 2023.08.24 |