Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- #include <vector>
- using namespace std;
- #define N 202
- int mas[N][N];
- struct El {
- int len;
- El(int l) {
- len = l;
- }
- };
- struct compare
- {
- bool operator()(const El& l, const El& r)
- {
- return l.len > r.len;
- }
- };
- int main() {
- int n, m;
- std::priority_queue<El, vector<El> ,compare> heap;
- cin >> n >> m;
- for (int i = 1; i <= n; i++) {
- int x;
- cin >> x;
- heap.push(El(x));
- }
- for (int i = 1; i <= n; i++) cout << heap.top().len << " ";
- return 0;
- }
Add Comment
Please, Sign In to add comment