Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <queue>
- #include <vector>
- using namespace std;
- struct estrutura {
- int x;
- bool operator < (const estrutura &e) const {
- return x < e.x;
- }
- };
- int main() {
- priority_queue <estrutura> Q;
- for (int i = 0; i < 10; i++) {
- estrutura e;
- e.x = (i * 23) % 51;
- Q.push(e);
- }
- while (!Q.empty()) {
- estrutura e = Q.top();
- Q.pop();
- printf("-> %d\n", e.x);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement