-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathend_corrupt.cpp
More file actions
56 lines (56 loc) · 1.23 KB
/
end_corrupt.cpp
File metadata and controls
56 lines (56 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <stdio.h>
#include <iostream>
#include <climits>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <vector>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <utility>
#include <queue>
using namespace std;
#define ll long long
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define si(n) scanf("%d", &n)
#define ss(n) scanf("%s", n)
#define pii pair <int, int>
#define pll pair <int, int>
#define plp pair <int, pll >
#define pb push_back
priority_queue <ll> pq;
int main ()
{
// freopen("inl.txt", "r", stdin);
// freopen("outu.txt", "w", stdout);
// ios_base::sync_with_stdio(0); // no printf/scanf must be present
ll cs, t, i, j, k, x, y, z, ans, q, m, n;
sl(n);
sl(m);
for (i = 0; i < n + m; i++)
{
sl(x);
if (x != -1)
{
pq.push(x);
}
else{
printf("%lld\n", pq.top());
pq.pop();
}
}
return 0;
}